A minimalist command-line torrent client.
- Only essential settings — each option has a clear purpose
- Reasonable defaults — works out of the box without configuration
- Extensibility — add new features as needed
# Dependency: libtorrent
# Ubuntu/Debian
sudo apt install python3-libtorrent
# Arch
sudo pacman -S libtorrent-rasterbar
# Fedora
sudo dnf install rb_libtorrent-python3
# Install the client
cd minitorrent
uv pip install -e .# Start background daemon (recommended)
mt daemon start
mt daemon status
mt daemon stop
# Add torrent
mt add "magnet:?xt=urn:btih:..."
mt add /path/to/file.torrent
mt add --select "magnet:?xt=..." # Interactively select files after adding
# List torrents
mt list
# Detailed status
mt status 1
# Control
mt pause 1
mt resume 1
mt remove 1
mt remove 1 --delete-files
# File management
mt files 1 # List files in torrent
mt select 1 # Interactively select/deselect files
# Interactive TUI dashboard
mt tui
# Real-time monitoring (non-interactive)
mt watch
# Configuration
mt config
mt config --download-dir ~/Torrents
mt config --max-download 1000 # KB/sFile: ~/.config/minitorrent/config.toml
# Where to save files
download_dir = "/home/user/Downloads"
# Port for incoming connections
port = 6881
# Speed limits in KB/s (0 = unlimited)
max_download_rate = 0
max_upload_rate = 0Only 4 settings. Each is clear and has a reasonable default value.
Want to add a new feature? Examples:
# In config.py, add field to dataclass:
@dataclass
class Config:
...
# Maximum simultaneous downloads
max_active_downloads: int = 3# In cli.py, add command:
@main.command()
@click.argument("torrent_id", type=int)
@click.pass_context
def files(ctx, torrent_id: int):
"""Show files in torrent."""
# ...# In client.py, in wait_for_alerts() method:
for alert in alerts:
if isinstance(alert, lt.torrent_finished_alert):
# Run script, send notification, etc.
passminitorrent/
├── pyproject.toml # Dependencies and metadata
├── README.md
└── minitorrent/
├── __init__.py
├── config.py # 4 settings, clear format
├── client.py # libtorrent wrapper (torrents + file operations)
├── daemon.py # Background daemon with Unix socket IPC
├── cli.py # Commands: add, list, pause, remove, files, select, tui, daemon...
└── tui.py # Textual TUI: dashboard + file selector
- File selection for download
- RSS feeds
- Web UI
- Completion notifications
- Scheduler (download only at night)
Because you understand every line of your own code.