A powerful, terminal-based BitTorrent client built with Go and Bubble Tea. Originally a web-based application, now refactored into a beautiful CLI experience.
- β Add torrents via .torrent files or magnet links
- β Real-time progress tracking with live download statistics
- β Start/pause/delete individual torrents
- β Automatic seeding after download completion
- β Multi-file torrent support with per-file progress
- β Configuration management with persistent settings
- π¨ Beautiful TUI powered by Bubble Tea
- π Live statistics - download rates, progress, peer counts
- β¨οΈ Keyboard navigation - vi-style bindings
- π± Responsive layout - adapts to terminal size
- π― Multiple views - main list, details, settings
- π High performance - built on anacrolix/torrent library
- π Protocol encryption - hide BitTorrent traffic from ISPs
- π Automatic directory creation - organized downloads
- πΎ Persistent state - resume downloads after restart
- π DHT support - trackerless torrent discovery
- Go 1.21 or later
- Terminal with 256-color support (most modern terminals)
- Minimum terminal size: 80x24 characters
# Clone the repository
git clone https://github.com/yourusername/intunja
cd intunja
# Install dependencies
go mod download
# Build
go build -o intunja
# Run
./intunjaFor automated tests or CI you can run a non-interactive "headless" mode which does not take control of the terminal. It prints a simple summary of the engine state every second.
# Run headless mode (will detect and use a running daemon if available)
./intunja headless
# Stop with Ctrl+CThe headless mode will use the remote daemon if one is running (it checks
/tmp/intunja-daemon.pid to determine that). Otherwise it will start a local
engine instance in-process.
- The application will create a
downloadsdirectory in the current folder - Default port:
50007(can be changed in settings) - Press
ato add your first torrent
The main screen shows all your torrents in a table format:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Name β Progress β Size β Down β Status β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ubuntu-22.04-desktop.iso β 45.2% β 3.2 GB β 5.1 MB/sβ Active β
β my-archive.zip β 100.0% β 1.5 GB β 0 B/s β Seedingβ
β large-dataset.tar.gz β 12.8% β 8.9 GB β 2.3 MB/sβ Active β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Key | Action |
|---|---|
β / β |
Navigate torrent list |
Enter |
View torrent details |
a |
Add torrent from file |
m |
Add torrent from magnet link |
s |
Start selected torrent |
p |
Pause selected torrent |
d |
Delete selected torrent |
c |
View configuration |
q |
Quit application |
| Key | Action |
|---|---|
Esc |
Back to main view |
s |
Start this torrent |
p |
Pause this torrent |
d |
Delete this torrent |
| Key | Action |
|---|---|
Enter |
Submit input |
Esc |
Cancel |
Backspace |
Delete character |
{
"AutoStart": true,
"DisableEncryption": false,
"DownloadDirectory": "./downloads",
"EnableUpload": true,
"EnableSeeding": true,
"IncomingPort": 50007
}| Option | Type | Default | Description |
|---|---|---|---|
AutoStart |
bool | true |
Start downloading immediately when torrent is added |
DisableEncryption |
bool | false |
Disable protocol encryption (not recommended) |
DownloadDirectory |
string | "./downloads" |
Directory where files are saved |
EnableUpload |
bool | true |
Allow uploading to other peers |
EnableSeeding |
bool | true |
Continue uploading after download completes |
IncomingPort |
int | 50007 |
Port for incoming peer connections |
Configuration can be modified in two ways:
-
Via CLI (planned feature):
./intunja --port 6881 --download-dir ~/Downloads -
Via config file:
./intunja --config /path/to/config.json
intunja/
βββ cmd/
β βββ cli.go # CLI implementation with Bubble Tea
βββ engine/
β βββ config.go # Configuration structure
β βββ engine.go # Engine core (torrent management)
β βββ torrent.go # Torrent state tracking
βββ main.go # Application entry point
βββ go.mod # Go module definition
βββ README.md
ββββββββββββββββββββββββββββββββββββββββββ
β Terminal UI (Bubble Tea) β
β ββββββββββββ ββββββββββββ ββββββββββ
β βMain View β β Details β βConfig ββ
β ββββββββββββ ββββββββββββ ββββββββββ
ββββββββββββββββββ¬ββββββββββββββββββββββββ
β
β
ββββββββββββββββββββββββββββββββββββββββββ
β Engine (State Manager) β
β βββββββββββββββββββββββββββββββββββ β
β β Torrent Map (InfoHash β State) β β
β βββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββ¬ββββββββββββββββββββββββ
β
β
ββββββββββββββββββββββββββββββββββββββββββ
β anacrolix/torrent Library β
β (BitTorrent Protocol Implementation) β
ββββββββββββββββββββββββββββββββββββββββββ
-
CLI Layer (
cmd/cli.go)- Handles user input
- Renders UI with Bubble Tea
- Updates every second (ticker)
- Manages view state
-
Engine Layer (
engine/)- Wraps anacrolix/torrent library
- Maintains torrent state
- Handles configuration
- Thread-safe operations
-
Storage Layer (anacrolix/torrent)
- Piece verification
- Disk I/O
- Peer management
- DHT/tracker communication
- Press
min the main view - Paste your magnet link:
magnet:?xt=urn:btih:HASH&dn=NAME&tr=TRACKER - Press
Enter
The client will:
- Connect to DHT/trackers
- Download torrent metadata
- Start downloading automatically (if
AutoStartis enabled)
- Press
ain the main view - Enter the path to your .torrent file:
/path/to/file.torrent - Press
Enter
Note: Relative and absolute paths are supported.
βββββββββββββββββββ 45.2%
- Filled portion (β): Downloaded
- Empty portion (β): Remaining
- Percentage: Overall completion
Shows current download speed:
5.1 MB/s- Actively downloading0 B/s- Paused or complete
- Loading...: Fetching metadata
- Active: Downloading pieces
- Seeding: Complete, uploading to others
- Stopped: Paused by user
Symptoms: Torrent stuck at 0%, status shows "Active" but no download
Solutions:
- Check if torrent is still actively seeded
- Try adding more trackers (via magnet link)
- Ensure your firewall allows incoming connections on the configured port
- Enable DHT (default: enabled)
Symptoms: Error on startup: "Invalid incoming port"
Solutions:
- Change the port in configuration
- Check if another BitTorrent client is running
- Use a port in the range 49152-65535 (dynamic ports)
Symptoms: Torrents added but never start downloading
Solutions:
- Check
AutoStartsetting (presscto view config) - Manually start torrent by pressing
s - Verify
DownloadDirectoryis writable
Symptoms: Download speed much slower than expected
Solutions:
- Check if
EnableUploadis disabled (reduces peer connections) - Verify your internet connection speed
- Try torrents with more seeders
- Check firewall/router settings for port forwarding
By default, the client uses protocol encryption to hide BitTorrent traffic from ISPs:
{
"DisableEncryption": false // Keep this false for privacy
}How it works:
- Encrypts peer wire protocol messages
- Makes traffic look like random data
- Prevents ISP throttling based on protocol detection
Note: This is NOT end-to-end encryption. It only obfuscates the protocol.
For optimal connectivity, configure port forwarding on your router:
- Find your local IP:
ifconfig(Linux/Mac) oripconfig(Windows) - Access router admin panel (usually
192.168.1.1) - Forward port
50007(or your configured port) to your local IP - Protocol: TCP
Why?: Allows peers to initiate connections to you, increasing swarm participation.
- No pause/resume: Stopping a torrent requires re-adding to resume (anacrolix limitation)
- No per-file control: Cannot start/stop individual files in multi-file torrents
- No bandwidth limiting: Global upload/download speed caps not yet implemented
- No search: Built-in torrent search removed in CLI version
- No watch folder: Cannot auto-add torrents from a directory
- Bandwidth throttling (max upload/download speed)
- Per-file priority selection
- Watch folder for auto-adding torrents
- Import/export torrent list
- RSS feed monitoring
- Scheduled downloads (start/stop at specific times)
- Remote control via REST API
- Plugin system for custom scrapers
- Web UI (bring back web interface as optional)
- Mobile app (Android/iOS)
- Cloud sync of torrent list
- Advanced statistics and graphs
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/yourusername/intunja
cd intunja
# Install dependencies
go mod download
# Run tests
go build -o intunja
# Run
./intunjaThis project is licensed under the MIT License - see the LICENSE file for details.
- anacrolix/torrent - Excellent BitTorrent library
- Bubble Tea - Beautiful TUI framework
- Lipgloss - Terminal styling
- Original cloud-torrent project - Inspiration for the engine design
- Enable port forwarding on your router
- Keep upload enabled - improves peer reciprocity
- Choose well-seeded torrents - more seeders = faster downloads
- Avoid ISP throttling - keep encryption enabled
- Close other bandwidth-heavy applications
- Limit active torrents - pause unused downloads
- Reduce seeding after completion - set
EnableSeeding: false - Use smaller piece sizes - reduces memory usage (can't change per-torrent)
Q: Can I run this on a server without a display?
A: Yes! The TUI works over SSH and doesn't require a graphical environment.
Q: Does this work on Windows?
A: Yes, but Windows Terminal or WSL is recommended for best experience.
Q: Can I use this with a VPN?
A: Yes, but ensure your VPN supports port forwarding for optimal performance.
Q: How do I resume a stopped torrent?
A: Select the torrent and press s. If it was deleted, you'll need to re-add it.
Q: Where are the downloaded files?
A: By default in ./downloads relative to where you run the binary. Check with c (config view).
Q: Can I import torrents from another client?
A: Not directly. You'll need to re-add them via magnet links or .torrent files.
Made with β€οΈ by the MINDSGN STUDIO (PTY) LTD