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

Config Management Commands

Manage individual stored configs after import.

These commands operate on config refs from xrat list configs. Numeric IDs are still accepted for compatibility.

When to Use These Commands

CommandUse when you want to
addStore one share link without creating a subscription source record
showInspect one stored config or subscription
enableInclude a config in normal filtered workflows
disableKeep a config stored but skip it in normal filtered workflows
deleteHide a config from normal lists, or remove a subscription
restoreBring a soft-deleted config back
purgePermanently remove all soft-deleted configs

Config State

active, enabled, and deleted are separate states.

StateMeaning
activeThe config used by the current managed runtime session.
enabledIncluded in normal list, test, and rotation workflows.
disabledStored but skipped by enabled-only workflows.
deletedSoft-deleted and hidden unless --deleted or --all used.

Use xrat connect <ref> when you want to start a proxy runtime. Use xrat rotate enable when you want the daemon to manage automatic rotation.


add

Add a single config URI directly to the database.

xrat add <input>

Arguments

ArgumentDescription
inputConfig URI: vless://..., vmess://..., ss://..., trojan://..., hysteria2://..., etc.

Examples

xrat add "vless://uuid@example.com:443?type=ws&security=tls#Node"

Unlike xrat import, xrat add does not create or update a subscription source record.


show

Show details for one stored config or subscription. The target is a required subcommand (config or subscription).

xrat show config <ref> [--json]
xrat show subscription <ref> [--json]

Arguments

ArgumentDescription
refConfig or subscription ref prefix

Flags

FlagDescription
--jsonPrint the result as JSON

Examples

xrat show config a1b2
xrat show config a1b2c3d4 --json
xrat show subscription f00d

enable

Enable a config.

xrat enable <ref>

Arguments

ArgumentDescription
refConfig ref prefix to use

Enabled configs are included in normal enabled-only workflows, such as:

xrat list configs --enabled-only
xrat test --enabled-only

enable/disable are idempotent: enabling an already-enabled config (or a deleted one) prints an informational notice and exits successfully without changing state.


disable

Disable a config.

xrat disable <ref>

Arguments

ArgumentDescription
refConfig ref prefix to use

Disabled configs remain in the database but are excluded from enabled-only queries, tests, and rotation candidate selection.


delete

Delete a config (soft by default) or a whole subscription. The target is a required subcommand (config or subscription).

xrat delete config <ref> [--hard]
xrat delete subscription <ref> [--yes]

Arguments

ArgumentDescription
refConfig or subscription ref prefix

Flags

FlagDescription
--hard(config) Permanently delete the config instead of soft
--yes(subscription) Skip the confirmation prompt

Soft-deleted configs are hidden from normal lists but can still be viewed with:

xrat list configs --deleted
xrat list configs --all

Use delete config --hard only when the row should be permanently removed. delete subscription permanently removes the subscription and all of its configs (plus their test history and runtime sessions), so it prompts for confirmation unless --yes is given.


restore

Restore a soft-deleted config.

xrat restore <ref>

Arguments

ArgumentDescription
refConfig ref prefix to use

restore only applies to soft-deleted configs. It does not recreate a config that was removed with delete config --hard.


purge

Permanently delete all soft-deleted configs in one step, along with their test history and runtime sessions.

xrat purge [--yes]

Flags

FlagDescription
--yesSkip the confirmation prompt

purge reports how many configs are pending and prompts for confirmation before deleting. In a non-interactive shell it aborts unless --yes is given. This is irreversible — restore anything you want to keep with xrat restore first.

xrat purge          # prompts: Permanently delete N soft-deleted config(s)? [y/N]
xrat purge --yes    # no prompt
  • stable refs — use short refs in place of numeric IDs
  • list — find config refs and filter by state
  • runtime — connect, disconnect, and inspect active sessions
  • tui — manage configs interactively