Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

xrat is a command-first CLI tool. All operations are invoked as subcommands.

Global Flags

These flags apply to every command:

FlagDescription
-v, --verboseIncrease log verbosity. Repeat: -v=info, -vv=debug, -vvv=trace
-q, --quietSuppress output except errors. Ignored if RUST_LOG is set
--database <path>SQLite database path override
--config <path>Config file path override
--xray <path>Xray binary path override
--v2ray <path>V2Ray binary path override
--sing-box <path>sing-box binary path override

Commands

CommandDescription
setupRun post-install setup (init, daemon, completions, desktop)
importImport a subscription URL, file, or raw text into the database
updateRefresh stored subscriptions by ref or all at once
addAdd a single config URI directly to the database
stable refsUse short stable refs instead of numeric database IDs
listList stored configs or subscriptions
showShow details for a stored config
enableInclude a config in normal operations
disableExclude a config from normal operations
deleteSoft-delete or permanently delete a config
restoreRestore a soft-deleted config
parseParse and validate config links without persisting
testTest connectivity and latency for stored configs
scanScan candidate IPs for TCP reachability
connectStart a managed proxy runtime for a stored config
disconnectStop the active managed proxy runtime
statusShow the managed proxy runtime status
daemonRun or control the daemon supervisor process
proxyControl auto-rotating proxy scheduling via the daemon
mmdbManage GeoLite2 MMDB assets and inspect GeoIP backend config
serveStart the local HTTP API server
tuiStart the interactive terminal UI
upgradeSelf-upgrade from the latest release or by building from source
versionPrint the xrat version

Common State Terms

These words appear across the CLI, TUI, API, and database:

TermMeaning
enabledIncluded in bulk tests and rotation candidate sets
disabledStored but normally skipped by filtered workflows
activeConfig attached to the current managed runtime session
deletedSoft-deleted row hidden from normal lists unless requested

Use connect to make a config active by starting a runtime session.

Logging

xrat uses tracing for structured logging. Control verbosity with:

  • -v / --verbose: info level
  • -vv: debug level
  • -vvv: trace level
  • -q / --quiet: error level only
  • RUST_LOG environment variable: overrides all flags

Logs are written to stderr.