byr-pt-cli
v0.1.11
Published
BYR CLI with OpenClaw-friendly JSON contract
Readme
byr-pt-cli
CLI for byr.pt with stable machine-readable output (--json) and script-friendly commands for browse/search/details/download/auth/user/meta.
Install
npm i -g byr-pt-cli
byr helpQuick start
# Use cookie (recommended)
export BYR_COOKIE='uid=...; pass=...'
# Or username/password
# export BYR_USERNAME='...'
# export BYR_PASSWORD='...'
byr search --query "ubuntu" --limit 5
byr get --id 1001
byr download --id 1001 --output ./1001.torrent --dry-runCommands
byr --help
byr --version
byr check --json
byr whoami --json
byr doctor --verify --json
byr browse --limit 20 --category movie --spstate free --json
byr search --query "ubuntu" --limit 5 --category movie --spstate free
byr search --imdb tt0133093 --json
byr get --id 1001
byr download --id 1001 --output ./1001.torrent
byr user info --json
byr meta categories --json
byr meta levels --json
byr auth status --verify --json
byr auth login --username "<username>" --password "<password>" --json
byr auth import-cookie --cookie "uid=...; pass=..." --json
byr auth import-cookie --from-browser chrome --profile "Default" --json
byr auth logout --jsonSearch filters
--categoryrepeatable / comma-separated, accepts alias or numeric ID--incldeadall|alive|dead(or0|1|2)--spstateall|normal|free|2x|2xfree|50|2x50|30(or0..7)--bookmarkedall|only|unbookmarked(or0|1|2)--imdbalternative to--query--pagepage index
Auth and config
Credential source priority:
CLI flags > ENV > ./.byrrc.json > ~/.config/byr-cli/config.json > ~/.config/byr-cli/auth.json
auth import-cookie supports:
- legacy BYR cookie:
uid=...; pass=... - current session cookie:
session_id=...; auth_token=...(optionalrefresh_token=...)
JSON contract
All commands support --json.
- success:
{ "ok": true, "data": ..., "meta": ... } - error:
{ "ok": false, "error": { "code": "...", "message": "...", "details": ... } }
Testing
Run package tests and checks:
pnpm --filter byr-pt-cli test
pnpm --filter byr-pt-cli checkLocal live smoke (requires valid BYR credentials):
BYR_LIVE=1 BYR_COOKIE='uid=...; pass=...' pnpm --filter byr-pt-cli test:liveFlow: search -> get -> download --dry-run -> user info.
