| Crates.io | localsend-rs |
| lib.rs | localsend-rs |
| version | 0.1.2 |
| created_at | 2026-01-16 00:25:23.597971+00 |
| updated_at | 2026-01-16 20:06:17.104036+00 |
| description | Rust implementation of LocalSend protocol - cross-platform file transfer tool |
| homepage | https://crosscopy.io |
| repository | https://github.com/CrossCopy/localsend-rs |
| max_upload_size | |
| id | 2047408 |
| size | 319,416 |
A high-performance, type-safe implementation of LocalSend protocol (v2) in Rust. This project provides both a library and a feature-rich CLI/TUI for secure, local network file and text transfers.
Protocol, SessionId, FileId, Token, Port) prevents bugs at compile time.Install CLI version:
cargo install localsend-rs
Install with interactive TUI:
cargo install localsend-rs --features tui
Then run with:
localsend-rs --help # CLI mode
localsend-rs tui # Launch TUI (if installed with --features tui)
Ensure you have Rust and Cargo installed. Clone the repository and build from source:
git clone https://github.com/CrossCopy/localsend-rs.git
cd localsend-rs
# CLI + HTTPS (default)
cargo build --release
# With TUI support
cargo build --release --features tui
# All features (CLI + HTTPS + TUI)
cargo build --release --features all
Scan the local network for available LocalSend instances:
cargo run --features https -- discover
Start the receiver server (HTTPS recommended for compatibility):
# Start receiving on default port (53317)
cargo run --features https -- receive --https
Send a file to a device by its alias or IP:
# Send by alias
cargo run --features https -- send "My Phone" ./photos/vacation.jpg
# Send by IP address (bypasses discovery)
cargo run --features https -- send 192.168.1.50 ./documents/report.pdf
You can send plain text instead of files by providing a string that isn't a file path:
cargo run --features https -- send "ROG16" "Hello from Rust CLI!"
For an interactive terminal-based UI:
cargo run --features all -- tui
discoverFind devices on the local network.
--timeout <SECS>: Search duration (default: 10s).--json: Output discovered devices in JSON format.receiveStart a LocalSend server to accept incoming transfers.
--port <PORT>: Custom port (default: 53317).--https: Enable TLS encryption (highly recommended).--alias <NAME>: Custom device name shown to others.--directory <PATH>: Save directory for received files (default: ./downloads).sendSend data to another device.
<TARGET>: Device alias, hostname, or IP address.<FILES...>: One or more file paths or text strings.--pin <PIN>: Optional PIN for protected transfers.tui (requires --features tui)Launch the interactive terminal-based UI for file transfers.
# With all features enabled
cargo run --features all -- tui
The codebase is organized into clean, domain-driven modules:
src/
├── core/ # Core domain logic
│ ├── builders.rs # Builder patterns (DeviceInfoBuilder)
│ ├── device.rs # Device operations
│ ├── file.rs # File operations
│ ├── session.rs # Session management
│ └── transfer.rs # Transfer state machine
├── crypto/ # Cryptography (modularized)
│ ├── fingerprint.rs # Device fingerprinting
│ ├── hash.rs # SHA-256 hashing
│ └── tls.rs # TLS certificate generation
├── storage/ # Storage abstraction
│ ├── traits.rs # FileSystem trait
│ └── tokio_fs.rs # Default implementation
├── discovery/ # Multicast UDP & HTTP discovery
├── server/ # Axum HTTP/HTTPS server
├── client/ # Request-based client
├── protocol/ # Protocol types & validation
│ ├── types.rs # Strong types (SessionId, FileId, etc.)
│ └── validation.rs # Protocol validation
├── cli/ # Command-line interface
├── tui/ # Terminal UI
├── error.rs # Structured error handling
└── prelude.rs # Convenience exports
SessionId, FileId, Token, Port)DeviceInfoFileSystem implementations for testingFileSystem trait enables mocking and alternative backends| Feature | Default | Description |
|---|---|---|
cli |
✅ | Command-line interface (clap-based) |
https |
✅ | TLS/SSL support for secure transfers |
tui |
❌ | Interactive terminal UI (ratatui-based) |
all |
❌ | Enable all features (cli + https + tui) |
# Default (cli + https)
cargo build
# CLI + HTTPS + TUI
cargo build --features all
# Development with all features
cargo build --release --features all
This project is under active development with focus on performance and type safety.
tokio::sync::RwLock for server, non-blocking try_read() for TUI# Run all tests
cargo test
# Run tests with specific features
cargo test --features all
# Run clippy for code quality
cargo clippy --all-features
# Check formatting
cargo fmt --check
This is a CrossCopy project - a high-performance Rust implementation of the LocalSend protocol for fast, secure local network file transfers.
MIT License - see LICENSE for details.