xtool
A collection of amazing command-line tools, currently featuring a full-featured TFTP (Trivial File Transfer Protocol) implementation.
Features
- TFTP Server: RFC-compliant TFTP server with support for read/write operations
- TFTP Client: Command-line client for downloading and uploading files
- Protocol Extensions: Supports blocksize, timeout, transfer size, and window size options
- Single Port Mode: Optional mode for NAT-friendly operations
Installation
Or install from crates.io:
Usage
TFTP Server
Start a TFTP server:
# Basic usage - serve files from /var/tftp on port 69
# Specify IP and port
# Read-only mode
# Single port mode (useful behind NAT)
TFTP Client
Download a file:
# Download file from server
# Download to specific location
# Specify port and options
Upload a file:
# Upload file to server
# Upload with different remote name
# Specify options
Serial Console
List available serial ports:
Monitor a serial port (interactive shell):
# Monitor COM1 with default baud rate (115200)
# Monitor with specific baud rate
# Use configuration file defaults (if port is set in .xtool.toml)
Key bindings:
Ctrl + ]: Exit monitor mode
File Transfer
Upload a file and get a token:
# 输出: token
Download a file by token:
Specify server and output path:
Options
Server Options:
-i, --ip <IP>: IP address to bind (default: 0.0.0.0)-p, --port <PORT>: Port to listen on (default: 69)-r, --read-only: Enable read-only mode (disable writes)-s, --single-port: Use single port mode
Client Options:
-p, --port <PORT>: Server port (default: 69)-b, --block-size <SIZE>: Block size in bytes (default: 512, max: 65464)-t, --timeout <SECONDS>: Timeout in seconds (default: 5)
Serial Options:
-b, --baud <RATE>: Baud rate (default: 115200)
Examples
Running Tests
# Run all tests
# Run only integration tests
# Run with output
Example Session
Terminal 1 (Server):
Terminal 2 (Client):
License
Apache-2.0