media-cli — Terminal Control for Your *arr Media Stack (Remote)
One bash script to manage your entire media automation stack from a remote machine. Search, add, download, and monitor movies and TV shows without touching a web UI.
Built for setups where the AI agent runs on a different host than the media services (e.g., a VPS running OpenClaw managing a home server's *arr stack). If everything runs on the same machine, use media-cli-local instead.
Source: https://github.com/solomonneas/media-cli
Install: Clone the repo and run the install script, or copy the media file to your PATH manually. See the GitHub README for details.
Supported Services
| Service | Required | What It Does |
|---|
| Sonarr | Yes | TV show management |
| Radarr |
Yes | Movie management |
| Prowlarr | Yes | Indexer management |
| qBittorrent | Yes | Download monitoring |
| Bazarr | Optional | Subtitles |
| Jellyseerr | Optional | User requests + trending |
| Tdarr | Optional | Transcode monitoring |
Setup
CODEBLOCK0
The setup wizard asks for API URLs and keys, saves to ~/.config/media-cli/config (chmod 600).
Commands
Movies
CODEBLOCK1
TV Shows
CODEBLOCK2
Downloads
CODEBLOCK3
Status & Monitoring
CODEBLOCK4
Subtitles (Bazarr)
CODEBLOCK5
Requests (Jellyseerr)
CODEBLOCK6
Transcoding (Tdarr)
CODEBLOCK7
Connection Modes
Local (services on same machine)
CODEBLOCK8
Remote via SSH (services on another host)
CODEBLOCK9
SSH mode tunnels all API calls through your existing SSH config. Services stay on localhost and are never exposed to the network. No additional ports or credentials needed beyond your normal SSH access. Windows hosts automatically use PowerShell's Invoke-RestMethod for POST requests.
AI Agent Integration
Commands are designed for easy parsing by AI agents. Any tool that can run shell commands works:
CODEBLOCK10
Works with OpenClaw, LangChain, Claude computer use, or any agent framework with shell execution.
Requirements
- - bash 4.0+
- curl
- python3 (standard library only, no pip)
- ssh (only for remote mode)
Technical Details
- - Single bash script (~900 lines)
- Talks to *arr v3 APIs (Sonarr/Radarr), v1 (Prowlarr), v2 (qBittorrent WebUI)
- Python3 used strictly for JSON parsing (standard library)
- No telemetry, no analytics, no network calls except to your own services
- Config stored at
~/.config/media-cli/config with chmod 600
media-cli — 通过终端控制你的 *arr 媒体栈(远程)
一个 bash 脚本,让你从远程机器管理整个媒体自动化栈。无需接触网页界面,即可搜索、添加、下载和监控电影与电视节目。
专为 AI 代理与媒体服务运行在不同主机上的场景设计(例如,运行 OpenClaw 的 VPS 管理家庭服务器的 *arr 栈)。如果所有服务运行在同一台机器上,请使用 media-cli-local。
来源: https://github.com/solomonneas/media-cli
安装: 克隆仓库并运行安装脚本,或手动将 media 文件复制到你的 PATH 路径中。详情请参阅 GitHub 的 README。
支持的服务
| 服务 | 必需 | 功能 |
|---|
| Sonarr | 是 | 电视节目管理 |
| Radarr |
是 | 电影管理 |
| Prowlarr | 是 | 索引器管理 |
| qBittorrent | 是 | 下载监控 |
| Bazarr | 可选 | 字幕 |
| Jellyseerr | 可选 | 用户请求 + 热门趋势 |
| Tdarr | 可选 | 转码监控 |
设置
bash
安装(先克隆并查看脚本)
git clone https://github.com/solomonneas/media-cli.git
cd media-cli
bash install.sh
配置(交互式向导)
media setup
测试
media status
设置向导会询问 API URL 和密钥,并保存到 ~/.config/media-cli/config(权限为 chmod 600)。
命令
电影
bash
media movies search 星际穿越 # 在线搜索
media movies add 星际穿越 # 添加 + 开始下载
media movies list # 显示库及下载状态
media movies missing # 已监控但无文件的影片
media movies remove 标题 # 移除(保留文件)
电视节目
bash
media shows search 绝命毒师 # 在线搜索
media shows add 绝命毒师 # 添加 + 搜索剧集
media shows list # 显示库及剧集数量
下载
bash
media downloads # 按状态显示所有种子
media downloads active # 显示活跃下载(速度 + 预计完成时间)
media downloads pause <哈希值|all>
media downloads resume <哈希值|all>
media downloads remove <哈希值> [true] # true = 同时删除文件
状态与监控
bash
media status # 健康状态 + 库数量 + 活跃下载
media queue # Sonarr/Radarr 下载队列
media wanted # 缺失的剧集 + 电影
media calendar 14 # 即将发布的内容(未来 N 天)
media history # 最近活动
media refresh # 触发库重新扫描
media indexers # Prowlarr 索引器状态
字幕(Bazarr)
bash
media subs # 需要的字幕
media subs history # 最近下载的字幕
请求(Jellyseerr)
bash
media requests # 待处理的用户请求
media requests trending # 热门趋势
media requests users # 用户列表及请求数量
转码(Tdarr)
bash
media tdarr # 状态 + 活跃工作进程
media tdarr workers # 每个文件的进度:百分比、帧率、预计完成时间
media tdarr queue # 排队等待处理的项目
连接模式
本地(服务在同一台机器上)
MEDIA_HOST=local
通过 SSH 远程连接(服务在另一台主机上)
MEDIA_HOST=ssh:hyperv-host # 使用 SSH 配置别名
MEDIAHOSTOS=linux # 或 windows
SSH 模式通过你现有的 SSH 配置隧道传输所有 API 调用。服务保持在 localhost 上,不会暴露到网络中。除了正常的 SSH 访问外,无需额外端口或凭据。Windows 主机自动使用 PowerShell 的 Invoke-RestMethod 处理 POST 请求。
AI 代理集成
命令设计为便于 AI 代理解析。任何能运行 shell 命令的工具都可以使用:
我缺少哪些剧集的剧集? → media wanted
添加继承之战 → media shows add 继承之战
现在正在下载什么? → media downloads active
暂停所有下载 → media downloads pause all
适用于 OpenClaw、LangChain、Claude 电脑使用或任何具有 shell 执行能力的代理框架。
要求
- - bash 4.0+
- curl
- python3(仅标准库,无需 pip)
- ssh(仅远程模式需要)
技术细节
- - 单个 bash 脚本(约 900 行)
- 与 *arr v3 API(Sonarr/Radarr)、v1(Prowlarr)、v2(qBittorrent WebUI)通信
- Python3 严格用于 JSON 解析(标准库)
- 无遥测、无分析、除你自己的服务外无网络调用
- 配置存储在 ~/.config/media-cli/config,权限为 chmod 600