{
  "markdown": "# tsm\n\nA CLI for [Transmission](https://transmissionbt.com/) BitTorrent client.\n\nRequires a running Transmission instance with RPC enabled — either `transmission-daemon` or the desktop app (Transmission-Qt/GTK) with remote access turned on. This tool connects to the [Transmission RPC API](https://github.com/transmission/transmission/blob/main/docs/rpc-spec.md) over HTTP/HTTPS.\n\n## tsm vs. transmission-remote\n\nBoth tools talk to the same [Transmission RPC API](https://github.com/transmission/transmission/blob/main/docs/rpc-spec.md). They complement each other.\n\n| Capability | [`transmission-remote`](https://formulae.brew.sh/formula/transmission-cli) | `tsm` |\n|---|---|---|\n| List / start / stop / remove torrents | Yes | Yes |\n| Add torrents (file, magnet, URL) | Yes | Yes |\n| Torrent info and file listing | Yes | Yes, with colored tables |\n| Per-file priority and skip/unskip | Yes | Yes |\n| Per-torrent speed limits and priority | Yes | Yes |\n| Sequential download | Yes | Yes (`tsm sequential`) |\n| Tracker add / remove | Yes | Yes, plus bulk replace across all torrents |\n| Reannounce | Yes | Yes |\n| Labels | Yes | Yes |\n| Filter / search torrents | Basic (`-F`) | Advanced query language (`ratio>2.0 AND label:movies AND age<7d`) |\n| Live TUI dashboard | No | Yes (`tsm top`) |\n| Directory watch + auto-add | No | Yes (`tsm watch`) |\n| Completion hooks with templates | Daemon-level script only | Template variables (`{name}`, `{download_dir}`, etc.) + inline `--on-complete` |\n| Config-driven seeding policies | No | Yes (`tsm policy apply` by label) |\n| Multi-profile config / login wizard | No (manual auth flags) | Yes (`tsm login`, `--profile`) |\n| Health check (connectivity + disk + port) | No | Yes (`tsm health`) |\n| JSON output on all commands | Raw RPC JSON | Structured JSON (`--json`) |\n| Shell completions | No | Yes (bash, zsh, fish) |\n| Daemon settings (encryption, DHT, PEX, LPD, cache) | Yes | No — use `transmission-remote` |\n| Bandwidth groups | Yes | No |\n| Alt-speed scheduling (time-based) | Yes | No (toggle only) |\n| Port mapping / peer limits / blocklist | Yes | No |\n| Rename torrent / find data | Yes | No |\n\n**In short:** `transmission-remote` is the complete low-level interface for every daemon setting. `tsm` covers day-to-day torrent management with better output, automation, and scripting support. Pick whichever fits your workflow — they talk to the same server and can be used interchangeably.\n\n## Install\n\n### Homebrew (macOS/Linux)\n\n```bash\nbrew install lu-zhengda/tap/tsm\n```\n\n### Prebuilt binaries\n\nDownload from [GitHub Releases](https://github.com/lu-zhengda/tsm/releases).\n\n### Cargo\n\n```bash\ncargo install transmission-cli\n```\n\n### From source\n\n```bash\ngit clone https://github.com/lu-zhengda/tsm.git\ncd tsm\ncargo install --path .\n```\n\n### Verify\n\n```bash\ntsm --version\n```\n\n## Quick Start\n\n```bash\n# Login (saves credentials with 600 permissions)\ntsm login\n\n# List all torrents (colored status + progress bars)\ntsm list\ntsm list --filter downloading --sort speed-down\ntsm list --filter \"ratio>2.0 AND label:movies\"\ntsm list --filter \"size>1GB AND age<7d\"\ntsm list --json\ntsm list --ids-only              # pipe-friendly: one ID per line\n\n# Search by name\ntsm search \"ubuntu\"\n\n# Add a torrent\ntsm add path/to/file.torrent\ntsm add \"magnet:?xt=urn:btih:...\" --paused\ntsm add https://example.com/file.torrent --download-dir /data\n\n# Manage torrents\ntsm start 42\ntsm stop 42\ntsm remove 42\ntsm remove 42 --delete           # also delete data\ntsm verify 42\ntsm reannounce 42                # force tracker reannounce\ntsm move 42 /new/path            # relocate torrent data\ntsm sequential 42                # enable sequential download\ntsm sequential 42 --off          # disable sequential download\n\n# Labels\ntsm label add 42 linux\ntsm label list 42\ntsm label remove 42 linux\n\n# Torrent details and file management\ntsm info 42\ntsm files 42                                             # list with priority/wanted columns\ntsm files 42 --priority high --priority-indices 0,1      # set file priority\ntsm files 42 --skip 2,3                                  # skip files\ntsm files 42 --unskip 2                                  # unskip files\n```\n\n## Tracker Management\n\n```bash\n# List trackers with seeder/leecher counts\ntsm tracker list 42\n\n# Add/remove trackers\ntsm tracker add 42 \"udp://tracker.opentrackr.org:1337/announce\"\ntsm tracker remove 42 \"udp://tracker.opentrackr.org:1337/announce\"\n\n# Bulk replace a tracker URL across all torrents\ntsm tracker replace --from \"udp://old-tracker.com/announce\" --to \"udp://new-tracker.com/announce\"\n```\n\n## Speed Control\n\n```bash\n# Session-level limits\ntsm speed\ntsm speed --set-down 1000 --set-up 500\ntsm speed --no-limit\ntsm speed --alt-on\n\n# Per-torrent limits and priority\ntsm speed 42 --set-down 500 --set-up 100\ntsm speed 42 --priority high       # high, normal, or low\ntsm speed 42 --no-honor-global     # exempt from session limits\ntsm speed 42 --no-limit            # remove per-torrent limits\n```\n\n## Seeding Policies\n\nDefine per-label seeding rules in your config file:\n\n```toml\n[[policies]]\nname = \"hd-movies\"\nmatch_label = \"4k\"\nseed_ratio = 2.5\nseed_idle_minutes = 4320\n\n[[policies]]\nname = \"tv-shows\"\nmatch_label = \"tv\"\nseed_ratio = 1.5\nseed_idle_minutes = 1440\n```\n\n```bash\ntsm policy list                   # show configured policies\ntsm policy apply --dry-run        # preview what would change\ntsm policy apply                  # apply matching policies\n```\n\n## Watch & Notifications\n\n```bash\n# Watch directory for .torrent files\ntsm watch ~/Downloads\ntsm watch ~/Downloads --paused --delete-after-add\n\n# Completion notifications\ntsm watch ~/Downloads --notify\n\n# Completion hooks with template variables\ntsm watch ~/Downloads --on-complete \"/path/to/script.sh {name} {id} {download_dir}\"\n```\n\nTemplate variables: `{name}`, `{id}`, `{download_dir}`, `{size}`, `{ratio}`\n\nConfig-based hooks:\n\n```toml\n[notifications]\non_complete = \"/path/to/script.sh {name} {id}\"\nwebhook = \"https://hooks.example.com\"\n```\n\n## Monitoring\n\n```bash\n# Live dashboard\ntsm top                           # q to quit, j/k to scroll\ntsm top --interval 5\n\n# Health check\ntsm health\ntsm health --json\n\n# Session info\ntsm session\ntsm stats\ntsm free\n```\n\n## Configuration\n\n### Login\n\n```bash\ntsm login                       # configure default profile\ntsm login --profile seedbox     # configure a named profile\ntsm login --keychain            # store password in macOS Keychain\n```\n\nInteractively prompts for host, port, and credentials, tests the connection, then saves to `~/.config/tsm/config.toml` with `600` permissions.\n\n### Keychain Support (macOS)\n\nWith `--keychain`, the password is stored in macOS Keychain instead of the config file. The config file stores a `keychain:` sentinel marker, and the real password is retrieved from Keychain at runtime.\n\n```bash\n# Store credentials in Keychain\ntsm login --keychain\ntsm login --profile seedbox --keychain\n\n# All subsequent commands use Keychain transparently\ntsm list                        # password fetched from Keychain automatically\n\n# CLI flags and env vars still override Keychain\ntsm --password override list\nTSM_PASSWORD=override tsm list\n\n# Remove a stored password from Keychain\nsecurity delete-generic-password -s tsm -a default\nsecurity delete-generic-password -s tsm -a seedbox\n```\n\nKeychain support requires macOS. On other platforms, `--keychain` returns an error.\n\n### Config Resolution\n\nHighest priority first: CLI flags > env vars > config file.\n\n**CLI flags:**\n\n```bash\ntsm --host myserver --port 9091 --username admin --password secret list\n```\n\n**Env vars:** `TSM_HOST`, `TSM_PORT`, `TSM_USERNAME`, `TSM_PASSWORD`, `TSM_PROFILE`\n\n**Config file** (`~/.config/tsm/config.toml`):\n\n```toml\n[default]\nhost = \"localhost\"\nport = 9091\nusername = \"admin\"\npassword = \"secret\"\n\n[profiles.seedbox]\nhost = \"seedbox.example.com\"\nport = 443\nusername = \"user\"\npassword = \"pass\"\n```\n\n```bash\ntsm --profile seedbox list\n```\n\n## JSON Output\n\nAll read commands support `--json` for scripting:\n\n```bash\ntsm list --json | jq '.[].name'\ntsm list --ids-only | xargs -I{} tsm info {} --json\ntsm health --json\ntsm --json policy list\ntsm --json tracker list 42\n```\n\n## Options\n\n```\n--no-color    Disable colored output (also respects NO_COLOR env var)\n--json        Output as JSON\n--host        Transmission host\n--port        Transmission port (443 auto-selects HTTPS)\n--profile     Config profile name\n```\n\n## Shell Completions\n\n```bash\ntsm completions bash >> ~/.bashrc\ntsm completions zsh >> ~/.zshrc\ntsm completions fish > ~/.config/fish/completions/tsm.fish\n```\n\n## License\n\nMIT\n",
  "bytes": 8621,
  "sha": "7ea3480c207a15e53ab45f6b1f30943545af57fc68b041c0f7da3384d4f67ddd",
  "repo_slug": "lu-zhengda/tsm",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_lu_zhengda_tsm_tsm_9c890363/readme"
}