transfercoffee-cli
v1.0.2
Published
A simple tool for securely sharing files using WebTorrent and mnemonics. This script allows you to upload a file and generate a mnemonic that can be used to download the file without sharing the actual file location.
Readme
Transfer.coffee CLI
A simple tool for securely sharing files using WebTorrent and mnemonics. This script allows you to upload a file and generate a mnemonic that can be used to download the file without sharing the actual file location.
Features
- Secure file sharing using peer-to-peer technology
- Mnemonic-based access for downloads
- One-time upload expiration (optional)
- Option to continue seeding after download
- Custom tracker URL support via environment variables
Installation
npm install -g transfercoffee-cliOr, if you prefer not to install globally:
npx transfercoffee-cliDependencies
commander- CLI parserwebtorrent- WebTorrent clientbip39- Mnemonic generationdotenv- Environment variables loading
Usage
Upload Command
transfercoffee upload <filePath> [--one-time]Description
Uploads a file and generates a mnemonic that can be used to download the file.
Options
--one-time- Exit once the file has been downloaded once
Example
transfercoffee upload /path/to/file.txt --one-timeDownload Command
transfercoffee download [words...] [--seed]Description
Downloads a file using a mnemonic.
Options
--seed- Continue seeding after the download is complete
Example
transfercoffee download "first second third fourth fifth sixth seventh eighth ninth tenth"Help Command
transfercoffee helpDisplays this help message.
Configuration
The script reads configuration from environment variables:
TRACKER_URL- Tracker URL (defaults to "wss://tracker.transfer.coffee")
You can create a .env file in your project directory with these variables if needed.
Examples
Uploading a File
$ transfercoffee upload /path/to/file.txt
Connecting to tracker: wss://tracker.transfer.coffee
File is seeding. InfoHash: abcdefghijklmnop...
Mnemonic for sharing: first second third fourth fifth sixth seventh eighth ninth tenthDownloading a File
$ transfercoffee download "first second third fourth fifth sixth seventh eighth ninth tenth"
Connecting to tracker: wss://tracker.transfer.coffee
Searching for seeds...
Downloading file: file.txt
Size: 1234567 bytes
Download complete: /path/to/file.txtTroubleshooting
- If you get an "Invalid mnemonic" error, make sure the mnemonic is valid and has exactly 12 or 24 words.
- If the upload/download process fails, check your internet connection and ensure the tracker URL is correct.
License
MIT License, see LICENSE
