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

parse

Parse and validate config links without persisting to the database.

xrat parse [input] [flags]

Arguments

ArgumentDescription
inputSingle config URI to parse (optional if using --file or --stdin)

Flags

FlagDescription
--file <path>Read config links (one per line) from a local file
--stdinRead config links (one per line) from stdin
--jsonPrint the generated runtime JSON config for the parsed node
--engine <engine>Proxy engine for runtime config generation: auto, xray, sing-box (default: auto)

Engine Modes

ModeBehavior
autoUses sing-box for hysteria2, xray for everything else
xrayAlways use Xray-core (rejects hysteria2)
sing-boxAlways use sing-box

This engine choice only affects parse-time validation and --json runtime config preview. Managed runtime commands such as xrat connect use the Xray/V2Ray lifecycle path.

Examples

Parse a single VLESS link:

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

Parse from a file:

xrat parse --file ./links.txt

Parse from stdin:

cat links.txt | xrat parse --stdin

Generate runtime JSON:

xrat parse --json "vless://uuid@example.com:443?type=tcp#Node"

Force sing-box engine:

xrat parse --engine sing-box "hy2://secret@example.com:443?sni=edge.example.com#HY2"

Output

Without --json, prints decoded node fields (protocol, address, port, network, TLS, SNI, etc.).

With --json, prints the full Xray or sing-box runtime configuration JSON that would be generated for the parsed node.