Secure P2P file transfer CLI with end-to-end encryption - No servers, no signups, just share
npm install ezshare-cliSecure P2P file transfer with end-to-end encryption - No servers, no signups, just share
Share files and folders directly between peers using decentralized Hyperswarm DHT. Works across different networks with built-in NAT traversal.



- š End-to-End Encryption ā AES-256-GCM authenticated encryption
- š Truly Decentralized ā Direct peer-to-peer via Hyperswarm DHT, no servers
- š NAT Traversal ā Works across different networks with automatic hole-punching
- ā” Adaptive Compression ā Zstandard compression (smart detection skips .zip, .mp4, etc.)
- š» Interactive Shell ā Claude Code-style TUI with slash commands and file browser
- š¦ Streaming Architecture ā Memory-efficient for files of any size
- š Cross-Platform ā Linux, macOS, and Windows
- Node.js 18+ (recommended: Node 20+)
That's it! Zstandard compression is bundled - no system dependencies needed.
``bash`
npm install -g ezshare-cli
Now you can use ezshare from anywhere!
`bash`
npx ezshare-cli
Simply type ezshare to launch the interactive shell:
`bash`
ezshare
You'll see:
`
EzShare CLI - P2P File Transfer
Type /ezshare to start or /help for commands
ezshare>
`
Available commands:
- /ezshare - Open the main menu/help
- - Show help screen/exit
- - Exit the applicationq
- - Quick exit (when in command mode)Esc
- - Go back to command mode
#### Using the Interactive Shell
1. Type /ezshare to open the main menuEnter
2. Choose Send or Receive
3. For Send:
- Use arrow keys (ā/ā) to navigate your file system
- Press on a folder to open itEnter
- Press on a file to select it for sharing
- Copy the generated share key
4. For Receive:
- Paste the share key from the sender
- Files save to current directory by default
Or use direct commands for quick transfers:
#### Send a file or directory
`bash`
ezshare send
Example:
`bash
$ ezshare send ./documents
š¤ Sending: documents
Size: 2.4 MB | Files: 3
Share this key with receiver:
BhhzKS7G4iIq4okKNYhaoqljeLMAjMR8UkpaLyqP7EA
ā Waiting for peer to connect...
`
#### Receive a file
`bash`
ezshare receive
Example:
`bash
$ ezshare receive BhhzKS7G4iIq4okKNYhaoqljeLMAjMR8UkpaLyqP7EA
š„ Receiving file(s)
Size: 2.4 MB | Files: 3
ā Connecting to peer...
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā 100%
ā Transfer complete!
Saved to: /current/directory
`
Specify output directory:
`bash`
ezshare receive
``
āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā
ā Sender ā ā Receiver ā
āāāāāāāā¬āāāāāāā āāāāāāāā¬āāāāāāā
ā ā
ā 1. Generate random topic key ā
ā 2. Display share key to user ā
ā ā
ā 3. Announce to Hyperswarm DHT āāāāāāāāāāāāāāāāāāāāāŗā 4. Look up in DHT
ā ā
āāāāāāāāāāāāāāāāāāā 5. P2P Connection āāāāāāāāāāāāāāā¤
ā (NAT hole-punching) ā
ā ā
ā Files ā Tar ā Compress* ā Encrypt (AES-256) ā
ā ā
āāāāāāāāāāāāāāāāāāāāŗ Transfer āāāāāāāāāāāāāāāāāāāāāāā¤
ā ā
ā Decrypt ā Decompress ā Extract ā Files
ā ā
āāāāāāāāāāāāāāāāāāā 6. Close Connection āāāāāāāāāāāāā¤
*Compression is skipped for already-compressed formats (.zip, .gz, .mp4, .jpg, etc.)
- Key Generation: Random 32-byte topic key generated per transfer
- Key Derivation: AES key derived from topic using HKDF-SHA256
- Encryption: AES-256-GCM with unique nonces per 64KB chunk
- Authentication: GCM mode provides integrity verification
- Transport: Hyperswarm uses Noise protocol for transport encryption
ā ļø Important: The share key is the only secret. Anyone with the key can receive the file. Share it securely (Signal, encrypted email, etc.).
| Component | Technology |
|-----------|------------|
| Runtime | Node.js 18+ with TypeScript ES Modules |
| P2P Network | Hyperswarm (Kademlia DHT + NAT traversal) |
| Encryption | AES-256-GCM (Node.js crypto) |
| Compression | Zstandard via @skhaz/zstd (bundled binaries) |
| Archiving | tar-stream (streaming tar) |
| TUI | Ink (React for CLI) |
| CLI Parser | meow |
``
ezsharecli/
āāā bin/
ā āāā ezshare.js # Global CLI entry point
āāā src/
ā āāā cli.tsx # Main CLI router (interactive vs direct mode)
ā āāā components/
ā ā āāā Shell.tsx # Interactive shell REPL
ā ā āāā MainMenu.tsx # Send/Receive menu
ā ā āāā FileBrowser.tsx # Arrow-key file navigator
ā ā āāā HelpScreen.tsx # Help documentation
ā ā āāā TransferUI.tsx # Transfer progress UI
ā āāā commands/
ā ā āāā send.tsx # Send command implementation
ā ā āāā receive.tsx # Receive command implementation
ā āāā utils/
ā āāā crypto.ts # AES-256-GCM encryption/decryption streams
ā āāā compression.ts # Zstd compression with format detection
ā āāā network.ts # Hyperswarm connection management
ā āāā tar.ts # Tar pack/extract utilities
ā āāā fileSystem.ts # File browser utilities
āāā package.json
āāā tsconfig.json
"Connection timeout after 30s"
- Ensure both sender and receiver are started within ~10 seconds
- Check firewall settings (Hyperswarm needs UDP for DHT)
- Try on different networks if behind restrictive NAT
"Could not find or connect to sender"
- Verify the share key is correct (copy-paste to avoid typos)
- Ensure sender is still running and waiting
- Both peers need internet connectivity for DHT bootstrap
- Large files (>1GB): Transfers work fine, but both peers should have stable connections
- Firewalls: Allow UDP traffic for best DHT performance
- Multiple files: Directory transfers are automatically tar-packed
bash
ezshare send presentation.pdf
`$3
`bash
ezshare send ./project-folder
`$3
`bash
ezshare receive ABC123XYZ --output ~/Downloads
`$3
`bash
ezshare
Then: /ezshare ā Send ā Navigate with arrows ā Select file
`š® Roadmap
- [ ] Resume interrupted transfers
- [ ] Multiple simultaneous receivers
- [ ] Transfer speed indicator and ETA
- [ ] QR code for share keys (mobile)
- [ ] Custom encryption passphrases
- [ ] Web UI companion app
- [ ] Transfer history
š¤ Contributing
Contributions are welcome! Here's how:
`bash
Clone the repository
git clone https://github.com/yourusername/ezsharecli.git
cd ezsharecliInstall dependencies
npm installRun in development
npm run devBuild
npm run buildRun tests
npm test
``Please open an issue before starting major features.
MIT License - see LICENSE for details.
- Built with Hyperswarm by Holepunch
- Inspired by Magic Wormhole
- TUI powered by Ink
---
Made with ā¤ļø for secure, decentralized file sharing