command line client - degoya/rDownloader GitHub Wiki

Command line client

The rdownloader binary is not only the service. It can also drive a running service — the local one, or one on another machine — over the REST API.

It never opens the database directly, so the service has to be running.

Connecting

Flag Environment variable Default
--server RDOWNLOADER_SERVER http://127.0.0.1:8710
--token RDOWNLOADER_TOKEN —
--timeout — 30 seconds
--json — table output otherwise

Issue a token under Settings → Clients & API → API & MCP. Read-only commands work with an api:read token; adding and removing need more. See Accounts, sessions and permissions.

Queue commands

rdownloader queue list
rdownloader queue summary
rdownloader queue add "https://example.com/file.bin"
rdownloader queue pause <id>
rdownloader queue resume <id>
rdownloader queue remove <id> --yes

queue add takes direct HTTP(S) links and magnets. Hoster links belong in the LinkGrabber — see below.

LinkGrabber commands

rdownloader links add "https://hoster.tld/file"
rdownloader links add - < links.txt
rdownloader links list
rdownloader links enqueue <package-id>
rdownloader links remove <id> --yes

links add - reads from standard input, one link per line — the route for a file of links or the output of another program. Three options shape where the links go:

Option Does
--category <name or id> Gives the links that category; a name is looked up, and an unknown one ends with exit code 2
--package <name> Puts all the links into one package of that name
--enqueue Sends them straight into the download list instead of the LinkGrabber

A category given by name needs a token that may read the categories (api:config); an id does not.

Feeding links from your own script

A script that finds links — scraping a page, reading a mailbox, querying a service — can hand them to the LinkGrabber by printing one per line:

./find-links.sh | rdownloader links add - --server http://nas:8710 --token "$TOKEN"

The token needs the api:intake area. The links arrive in the LinkGrabber as one batch and are checked and grouped like any pasted list; add --category, --package or --enqueue as above. Run the script from cron or the Windows Task Scheduler.

Without an outside scheduler, let rDownloader run the script itself: an Own script subscription runs it on an interval or a cron schedule and keeps a run history.

Following events

rdownloader events
rdownloader events --json | jq -r '.kind'

events follows the service's live event stream — the same one the web interface follows — one line per event: the time to the second, the event's name and its payload, shortened to fit a line. With --json each line is the event's JSON (JSON Lines), ready for jq or a script. It shows what the token's areas allow it to see. When the connection drops, it connects again and carries on after the last event it saw, so nothing in between is lost; a refused token ends it with the exit codes below. Stop it with Ctrl+C.

Shell completion

rdownloader completions <shell> prints the completion script for bash, zsh, fish, powershell or elvish. Load it the way your shell expects, for example:

rdownloader completions bash > ~/.local/share/bash-completion/completions/rdownloader
rdownloader completions zsh > "${fpath[1]}/_rdownloader"
rdownloader completions fish > ~/.config/fish/completions/rdownloader.fish

In PowerShell, add rdownloader completions powershell | Out-String | Invoke-Expression to your profile. The script completes every command and flag.

Removals need --yes

Every destructive command requires --yes; there is no interactive prompt.

Output

A table by default; the server's unchanged JSON with --json. Pipe the latter into jq for scripting.

Exit codes

Code Meaning
0 Success
1 Anything else
2 Bad arguments
3 Server unreachable
4 Credential rejected
5 Not found

So a script can tell "the server is down" from "the token is wrong" without parsing text.

The other subcommands

rdownloader also carries commands that are not about a running service:

Command Page
serve Installation
doctor Diagnostics and maintenance
doctor site-rules Diagnostics and maintenance
openapi [--output PATH] REST API
plugin … Packaging, signing and distribution
tools … External tools — signing the managed-tool manifest
update … Updates — builds, signs and verifies a release's signed update list (for maintainers)
autostart install|remove Installation
stop [--wait SECONDS] Installation — stops the service on this machine cleanly and waits until it has ended
auth reset-password, auth password-login on Accounts, sessions and permissions, Sign in with an identity provider — sign-in steps only this machine may take

Related pages

⚠️ **GitHub.com Fallback** ⚠️