A full-featured Python CLI wrapper for the TorBox API v1.
Legal Disclaimer: This project is an unofficial, third-party, open-source command-line interface for the TorBox API. It is not affiliated with, endorsed by, sponsored by, or connected to TorBox or its parent/operating entities in any capacity. The name "TorBox" and any associated trademarks are the property of their respective owners. This tool is provided "as is" without warranty of any kind, express or implied. Use of this CLI is at your own risk and subject to the TorBox Terms of Service and API usage policies.
pipx install torbox-cliOr with uv:
uv tool install torbox-cli- Python 3.10+
- Optional:
guessit(bundled) for rich torrent filename parsing
export TORBOX_API_KEY=your-key
# Check version and auth
torbox --version
torbox general status --json
# Enable shell completion
source <(torbox --show-completion bash) # bash
source <(torbox --show-completion zsh) # zsh
torbox --install-completion fish # fish
# List your torrents
torbox torrents listYou already use the TorBox web UI to manage downloads. But every time you want to automate a workflow, integrate with a media server, or run a cron job, you're back to writing fragile curl scripts by hand.
torbox-cli is the missing piece: a composable, scriptable interface to your entire TorBox account. Search for content, add downloads, monitor progress, and extract results — all from the command line, ready to pipe into your existing toolchain.
- Search → Add → Monitor without opening a browser. Search torrent streams by title or IMDB ID, filter by quality and cache status, and add them directly to your queue.
- Rich, human-readable output when you're exploring, machine-readable JSON when you're scripting.
- Preview every destructive action with
--dry-runbefore you commit.
- Structured JSON envelopes via
--json/-j— predictable output forjq,xargs, and LLM agents. - Pluck nested fields with
--fieldso you never writejq '.data[0].name'by hand. - Single-line JSON with
--compactfor streaming through GNU parallel and other line-oriented tools. - Pagination (
--offset,--limit) for iterating through massive datasets reliably.
- Auto-retry with exponential backoff on rate limits — your cron jobs don't die at 2 AM because of a 429.
- Flexible auth that adapts to any environment: CLI flag, env var,
.envfile, or XDG config profiles. - Multi-account support via INI-style profiles — switch accounts mid-script for batch operations across plans.
- Request observability with
--verbose/-v— full headers, timing, and retry logging when things go wrong. - Config doctor (
torbox config doctor) exposes exactly which auth source is active and why.
- Tab-complete everything — full shell completion for bash, zsh, and fish.
- Offline docs — generate man pages with
torbox docs --man. - Every TorBox v1 endpoint exposed as an intuitive subcommand.
# One-liner: find cached 1080p streams, sort by seeders, pipe to jq
torbox search streams "inception" --resolution 1080p --cached --sort seeders --json --compact | jq '.name'
# Batch-create torrents from a file without surprises
cat magnets.txt | xargs -I {} torbox torrents create {} --dry-run
# Multi-profile automation: switch accounts mid-script
torbox --profile work torrents list --json --field data
# Cron-safe: auto-retry with backoff so rate limits don't kill nightly jobs
torbox torrents list --auto-retry --json --quiet > /var/log/torbox-backup.json
# Debug a failing command in one flag
torbox general status --verbose
# Inspect why auth isn't resolving where you expect
torbox config doctor| Group | Commands |
|---|---|
general |
status, stats, changelogs, speedtest |
search |
streams, library, popular, info |
torrents |
list, info, files, create, control, checkcached (hashes, show), requestdl, export, async-create, edit |
usenet |
list, create, control, requestdl, export, edit, checkcached |
webdl |
list, create, async-create, control, edit, requestdl, checkcached, hosters |
user |
me, transactions, transaction-pdf, settings, searchengines, auth-device-start, auth-device-poll, auth-device-complete, confirmation |
rss |
list, items, create, edit, delete |
queued |
list, add, control |
stream |
create, data, delete |
notifications |
list, rss, test, clear |
monitor |
htop-style live TUI dashboard (torrents, usenet, webdl, queued) |
integrations |
jobs, cancel |
Run torbox --help or torbox <group> --help for detailed usage and examples.
The search group uses TorBox's Stremio addon endpoints to find torrent streams and browse metadata. These are unofficial endpoints that may change without notice.
Note: Search requires a TorBox API key. Configure it via
TORBOX_API_KEY,--api-key, or a config file.
| Command | Description |
|---|---|
streams |
Search torrent streams by title or IMDB ID |
library |
Search your TorBox library by filename |
popular |
Browse popular/trending titles from Cinemeta |
info |
Show full metadata (plot, rating, cast, etc.) for an IMDB ID |
Search for torrent streams by title (auto-resolved via Cinemeta) or direct IMDB ID.
# Search by title (interactive Cinemeta picker)
torbox search streams "the matrix"
# Search by IMDB ID directly
torbox search streams tt0133093
# Series with season/episode
torbox search streams tt0944947 --season 1 --episode 1
torbox search streams tt0944947:1:1 # colon notation shorthand| Flag | Description | Example |
|---|---|---|
-t, --type |
Content type: movie, series, anime |
--type series |
-s, --season |
Season number (series only) | --season 2 |
-e, --episode |
Episode number (series only) | --episode 5 |
--first |
Auto-select first Cinemeta match (skip interactive) | --first |
--resolution |
Filter by resolution: 1080p, 720p, 4k, etc. |
--resolution 1080p |
--cached |
Only show cached (Instant) streams | --cached |
--not-cached |
Only show non-cached streams | --not-cached |
--min-size |
Minimum file size | --min-size 1GB |
--max-size |
Maximum file size | --max-size 10GB |
--min-seeders |
Minimum seeders count | --min-seeders 50 |
--quality |
Filter by quality tag (e.g., BLURAY, WEB-DL) |
--quality BLURAY |
--source |
Filter by source (e.g., Blu-ray, Web) |
--source Web |
--sort |
Sort by: seeders, size, quality |
--sort seeders |
--limit |
Max results to display (default: 20) | --limit 50 |
--genre |
Filter Cinemeta results by genre (see list below) | --genre Action |
--details |
Show metadata panel (rating, runtime, plot) before streams | --details |
-j, --json |
Output raw JSON | --json |
-f, --field |
Extract specific field from JSON | --field streams.0.name |
# High-quality cached streams only
torbox search streams tt0133093 --resolution 1080p --cached --sort seeders
# Big files with lots of seeders
torbox search streams "interstellar" --first --min-size 5GB --min-seeders 100
# Auto-resolve title, filter by genre, show metadata
torbox search streams "action movie" --first --genre Action --details
# JSON output for scripting
torbox search streams tt0133093 --json --field streamsSearch files already in your TorBox library by filename or partial name.
# Search library for a file
torbox search library "batman"
# JSON output
torbox search library "batman" --jsonBrowse popular movies or series from Cinemeta without a search query. After showing results, pick a number to auto-search streams for that title.
# Browse popular movies (interactive)
torbox search popular
# Popular series, limit to 5 results
torbox search popular --type series --limit 5
# JSON output (no interactive prompt)
torbox search popular --jsonShow detailed metadata for any IMDB ID: description, rating, runtime, genres, cast, director, and poster.
# Show metadata for a movie
torbox search info tt0133093
# Metadata for a series
torbox search info tt0944947 --type series
# JSON output for further processing
torbox search info tt0133093 --jsonHuman-mode stream output includes rich metadata extracted from torrent filenames via guessit:
- Filename — Torrent filename (truncated if long)
- Quality — Quality tag from stream description
- Size — File size in human-readable format
- Seeders — Number of seeders
- Source — Source type (Blu-ray, Web, etc.)
- Group — Release group (e.g., YIFY, SPARKS, NTb)
- Year — Release year extracted from filename
- Cached — Checkmark if cached on TorBox
torbox search <query> without a subcommand defaults to streams:
torbox search "the matrix" # same as: torbox search streams "the matrix"
torbox search tt0133093 --cached # same as: torbox search streams tt0133093 --cached- Unofficial endpoints: The Stremio addon endpoints are not part of the official TorBox REST API and may change.
- Cinemeta dependency: Title resolution requires
v3-cinemeta.strem.ioto be available. If it's down, use an IMDB ID directly. - Cinemeta results may vary: Metadata availability, accuracy, and completeness depend on a third-party service outside our control.
- No results: If no streams are found, try broadening filters or searching without them.
- Series without season/episode: Some streams may work without specifying season/episode, but most require them.
See DISCLAIMER.md for full legal and third-party service disclaimers.
Check cache status for all episodes of a TV show in a single command. This discovers episodes via Cinemeta, then queries the TorBox Stremio addon for each episode in parallel, and aggregates the results into a single table.
# Check all episodes of Season 1
torbox torrents checkcached show tt0944947 --season 1
# Only check specific episodes
torbox torrents checkcached show tt0944947 --season 1 --episodes 1,2,3
# Filter to only cached episodes
torbox torrents checkcached show tt0944947 --season 1 --cached
# JSON output for scripting
torbox torrents checkcached show tt0944947 --season 1 --json
# Sort by best quality
torbox torrents checkcached show tt0944947 --season 1 --sort quality- Uses parallel requests (
--max-workerscontrols concurrency, default 20). - Supports all standard stream filters:
--resolution,--cached/--not-cached,--min-seeders,--quality,--source,--min-size,--max-size. - Backward compatible:
torbox torrents checkcached hash1 hash2still works (defaults tohashessubcommand).
| Flag | Default | Description | Example |
|---|---|---|---|
-s, --season |
— | Season number | --season 1 |
-e, --episodes |
— | Comma-separated episode numbers | --episodes 1,2,3 |
--resolution |
— | Filter by resolution | --resolution 1080p |
--cached / --not-cached |
— | Filter by cache status | --cached |
--min-seeders |
— | Minimum seeders | --min-seeders 50 |
--quality |
— | Filter by quality tag | --quality BLURAY |
--source |
— | Filter by source | --source Web |
--min-size |
— | Minimum file size | --min-size 1GB |
--max-size |
— | Maximum file size | --max-size 10GB |
--sort |
episode |
Sort: episode, seeders, quality, cached |
--sort quality |
--limit |
20 |
Max streams per episode | --limit 50 |
--max-workers |
20 |
Parallel Stremio request workers | --max-workers 10 |
-j, --json |
— | JSON output | --json |
-f, --field |
— | Dot-path extract | --field episodes.0.title |
The --genre flag filters Cinemeta search results client-side. Genres come from IMDB/OMDb metadata. Common genres include:
Action,Adventure,AnimationBiography,Comedy,CrimeDocumentary,DramaFamily,FantasyHistory,HorrorMusic,Musical,MysteryRomanceSci-Fi,SportThrillerWar,Western
Use exact case-insensitive matching: --genre "Sci-Fi", --genre action, and --genre ACTION all work.
--details is a boolean flag (no value needed). When present, it fetches full Cinemeta metadata for the resolved IMDB ID and displays a rich panel with:
- Title and year
- IMDB rating
- Runtime
- Genres
- Plot description (truncated to ~200 chars)
This appears before the stream results table. It has no effect with --json or --field.
Full-screen htop-style TUI dashboard showing live download activity across all TorBox categories. Polls all 4 list endpoints in parallel and refreshes every second.
# Start the monitor
torbox monitor
# Custom refresh interval and sort
torbox monitor --interval 2 --sort speed
# Filter by name substring
torbox monitor --filter linux
# Fewer columns for small terminals
torbox monitor --compact TorBox Monitor Active: 7 DL: 45.2 MB/s Sort: status Ctrl-C quit
Torrents (3)
ID Name Status Size Progress Speed ETA
42 Game of Thrones DL 8.2 GB ████░ 67% 12.3MB/s 3m42s
15 Ubuntu 22.04 SD 4.5 GB █████100% - -
Usenet (2)
ID Name Status Size Progress Speed ETA
10 Linux ISO DL 2.1 GB ██░░░ 34% 5.1MB/s 5m12s
Web Downloads (1) / Queued (1)
ID Name Status Size Progress Speed ETA
20 file.zip DL 500 MB ░░░░░ 12% 2.3MB/s 3m10s
5 Music Album WA - - - -
| Flag | Default | Description |
|---|---|---|
-i, --interval |
1.0 |
Refresh interval in seconds |
-s, --sort |
status |
Sort column: status, name, size, speed, progress |
-f, --filter |
— | Filter items by name or status substring |
-l, --limit |
20 |
Max items per category |
--compact |
— | Hide type badge, speed, and ETA columns |
--auto-retry |
— | Auto-retry on rate limits |
Press Ctrl-C to exit. The terminal is restored cleanly.
Create an INI-style config at ~/.config/torbox-cli/config.env:
[default]
TORBOX_API_KEY = tb-your-default-key
[work]
TORBOX_API_KEY = tb-your-work-key
TORBOX_TIMEOUT = 60Select a profile with torbox --profile work torrents list.
Command (typer) → Helpers → Client (httpx) → API
↓
Formatters (rich / JSON)
The CLI follows a layered design: Typer commands validate input, the client handles auth/retries/error mapping, and formatters produce either rich tables for humans or normalized JSON envelopes for machines.
Use torbox config doctor to inspect which auth source is active and what the effective values are.
| Exit Code | Meaning |
|---|---|
| 1 | General / validation error |
| 2 | Authentication failure |
| 3 | API / server error |
| 4 | Rate limited |
| 5 | Plan restricted |
| 6 | Not found |
| 130 | Interrupted (Ctrl-C) |
uv sync— install dependencies.pre-commit install— enable git hooks.- Add the Pydantic model to
torbox/models.py. - Add the CLI command to
torbox/commands/*.pywith real-worldhelp=text. - Add tests in
tests/test_<group>.py. - Run
uv run ruff check torbox/ tests/anduv run mypy --strict torbox/. - Run
uv run pytest tests/(coverage threshold: 65%).
- DISCLAIMER.md — legal disclaimer and third-party service notices
- CHANGELOG.md — version history and release notes
- TorBox API Documentation
- TorBox Terms of Service
- Install:
pip install git+https://github.com/SwordfishTrumpet/torbox-cli.git
MIT