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
importImport a subscription URL, file, or raw text into the database
addAdd a single config URI directly to the database
listList stored configs or subscription sources
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
geoipManage GeoLite2 MMDB assets and inspect GeoIP backend config
serveStart the local HTTP API server
tuiStart the interactive terminal UI

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.