arr-cli
v1.0.0
Published
Single-file bash CLI for the *arr media stack — Sonarr, Radarr, Prowlarr, qBittorrent, Bazarr, Jellyseerr, Tdarr, and more.
Downloads
104
Maintainers
Readme
media-cli is a single bash script that wraps the APIs of your entire media automation stack into simple, memorable commands. No Docker, no Node, no Python packages. Just curl, python3 (for JSON parsing), and your existing *arr setup.
Built for humans who manage media servers from the terminal, and for AI agents that do it on their behalf.
$ media movies search "Interstellar"
[157336] Interstellar (2014) 169min
The adventures of a group of explorers who make use of a newly discovered wormhole...
$ media movies add "Interstellar"
✅ Added: Interstellar (2014) - Searching for downloads...
$ media downloads active
[ 23.4%] Interstellar.2014.1080p.BluRay.x265 (4.2 MB/s) 12mSupported Services
| Service | Status | What it does | |---------|--------|-------------| | Sonarr | Required | TV show search, add, monitor, manage | | Radarr | Required | Movie search, add, monitor, manage | | Prowlarr | Required | Indexer status and management | | qBittorrent | Required | Download monitoring and control | | Bazarr | Optional | Subtitle status and history | | Jellyseerr | Optional | User requests and trending content | | Tdarr | Optional | Transcode monitoring (GPU/CPU worker progress) |
Requirements
bash4.0+curlpython3(standard library only, no pip)ssh(only if using remote mode)
Install
One-liner:
curl -fsSL https://raw.githubusercontent.com/solomonneas/media-cli/main/media -o ~/bin/media && chmod +x ~/bin/mediaOr clone:
git clone https://github.com/solomonneas/media-cli.git
cd media-cli
bash install.shMake sure ~/bin is in your PATH (add export PATH="$HOME/bin:$PATH" to your shell profile if needed).
Quick Start
# 1. Run the setup wizard
media setup
# 2. Test your connection
media status
# 3. Start using it
media movies search "The Matrix"
media shows add "Breaking Bad"
media downloads activeThe setup wizard asks for your API URLs and keys, then saves everything to ~/.config/media-cli/config. You can also copy config.example and edit it by hand.
Finding Your API Keys
| Service | Where to find it | |---------|-----------------| | Sonarr | Settings > General > API Key | | Radarr | Settings > General > API Key | | Prowlarr | Settings > General > API Key | | Bazarr | Settings > General > API Key | | Jellyseerr | Settings > General > API Key | | qBittorrent | Settings > Web UI > Username/Password |
Or grab them from the config files directly:
# Linux
grep -i apikey ~/.config/Sonarr/config.xml
grep -i apikey ~/.config/Radarr/config.xml
# Windows
type C:\ProgramData\Sonarr\config.xml | findstr ApiKey
# Docker
docker exec sonarr cat /config/config.xml | grep ApiKeyCommands
Library
media movies list # List all movies with download status
media movies search "title" # Search online (via Radarr)
media movies add "title" # Add top result + start downloading
media movies remove "title" # Remove from library (keeps files)
media movies missing # Show monitored movies without files
media shows list # List all shows with episode counts
media shows search "title" # Search online (via Sonarr)
media shows add "title" # Add top result + search for episodes
media shows remove "title" # Remove from library (keeps files)Downloads
media downloads # List all torrents grouped by state
media downloads active # Active downloads with speed + ETA
media downloads pause <hash|all>
media downloads resume <hash|all>
media downloads remove <hash> [true] # true = also delete filesMonitoring
media status # Service health + library counts + active downloads
media queue # Sonarr/Radarr download queues
media wanted # Missing episodes and movies
media calendar [days] # Upcoming releases (default: 7 days)
media history [sonarr|radarr|all] [limit]
media indexers # List Prowlarr indexers
media refresh [movies|shows|all] # Trigger library rescanSubtitles (Bazarr)
media subs # Wanted subtitles for movies + episodes
media subs history # Recent subtitle downloadsRequests (Jellyseerr)
media requests # Pending user requests
media requests trending # What's trending
media requests users # User list with request countsTranscoding (Tdarr)
media tdarr # Status, resources, active workers
media tdarr workers # Per-file progress: %, fps, size reduction, ETA
media tdarr queue # Items queued for processingConnection Modes
Local Mode
Services run on the same machine as the CLI:
MEDIA_HOST="local"SSH Mode
Services run on a remote host (NAS, dedicated server, Windows box) and bind to localhost. The CLI runs curl commands over SSH:
MEDIA_HOST="ssh:mediaserver" # Uses your SSH config alias
MEDIA_HOST_OS="linux" # or "windows"This is the killer feature for headless servers. Your services don't need to be exposed to the network. The CLI tunnels everything through SSH.
Windows hosts work too. POST requests automatically use PowerShell's Invoke-RestMethod when MEDIA_HOST_OS="windows", so you don't need curl installed on the Windows side.
AI Agent Integration
This CLI was built alongside OpenClaw, an AI agent platform. The commands are designed to be easily parsed by AI assistants.
Any AI agent or automation tool that can run shell commands can use media-cli:
Natural language to commands:
"What shows am I missing episodes for?"
media wanted"Add Succession and start downloading it"
media shows add "Succession""What's actively downloading right now?"
media downloads active"Pause all downloads"
media downloads pause allWorks with OpenClaw, LangChain tool calling, Claude computer use, or any agent framework that supports shell execution.
How It Works
┌──────────────┐ ┌─────────────────────────┐
│ media-cli │────▶│ SSH (optional) │
│ (your box) │ │ curl commands run on │
└──────────────┘ │ the media server │
└───────────┬─────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌──────────┐
│ Sonarr │ │ Radarr │ │ Prowlarr │
│ :8989 │ │ :7878 │ │ :9696 │
└────────┘ └────────┘ └──────────┘
│ │
▼ ▼
┌──────────────────────┐
│ qBittorrent │
│ :8080 │
└──────────────────────┘
│
┌────┴────┐
▼ ▼
┌────────┐ ┌───────────┐ ┌───────┐
│ Bazarr │ │Jellyseerr │ │ Tdarr │
│ :6767 │ │ :5055 │ │ :8265 │
└────────┘ └───────────┘ └───────┘- Single bash script (~900 lines), no external dependencies
- Talks to *arr v3 APIs (Sonarr/Radarr), v1 (Prowlarr), v2 (qBittorrent WebUI)
- Python3 is used strictly for JSON parsing (standard library only)
- Config file is stored at
~/.config/media-cli/configwithchmod 600 - No telemetry, no analytics, no network calls except to your own services
Contributing
PRs welcome. Some ideas:
- [ ] Lidarr support (music)
- [ ] Readarr support (books)
- [ ] Tab completion (bash/zsh)
- [ ] Interactive mode (fzf-based search and select)
- [ ] Notification hooks (Discord/Telegram on download complete)
- [x] Tdarr integration (transcode status, worker progress, queue)
