CLI & configuration reference
Subcommands, options, and --json output shapes for the dsh-zen-remote CLI. The CLI communicates with the running plugin over a local 0600 IPC socket (~/.dsh/zen-remote-cli.sock).
Command table
Every command accepts --json (structured output) and --lang zh|en; -h/--help and -v/--version work everywhere. When running setup interactively without --lang or ZEN_REMOTE_LANG, a language picker runs first and switches all subsequent prompts immediately; TTY sessions support ↑/↓, Space, ←/→, and Enter keyboard controls, while scripts fail immediately on missing flags (pass all flags + --yes in CI). Positional arguments and named flags are interchangeable (peer join <uri> = --invite <uri>; client pair <url> = --host-url <url>).
| Command | What it does | Key options |
|---|---|---|
| setup | Three-step wizard: language → preflight → role → ingress / OAuth peer join | --role host|client|peer, --profile p1,p2, --oauth|--oauth-browser|--oauth-device, --network <id>, --relay <id|auto>, --invite <uri>, --host-url <url>, --yes, --no-wait |
| status | Full local state: identity + per-role sections | --json, --debug [outPath] |
| host device pair | Mint one device pairing code | --device-role web|desktop-client, --json |
| host device list | Gateway device table | --json |
| host device revoke | Revoke one or all device pairings | <id> or --all, --yes, --json |
| host ingress start | Start an ingress path (four modes) | --mode caddy|cloudflared|external|lan (--ingress synonym) plus per-mode flags (--domain, --cf-token, --email, --https-port, --public-url, --tunnel-id, --proxy) |
| host ingress stop | Stop managed ingress processes | --yes, --json |
| host ingress verify | Connectivity self-check (three lights) | --json |
| host ingress snippet | Print a reverse-proxy config snippet | --proxy nginx|caddy|lucky |
| client pair | Pair with one Host | [hostUrl], --code <8-digit>, --name <this machine>, --json |
| client unpair | Remove a pairing | <hostUrl|entryId> or --all, --yes, --json |
| client list | Paired-host table | --json |
| peer join | Join via official OAuth (browser / SSH device code + edge probe) or invite link | --oauth | --oauth-browser | --oauth-device, --network <id>, --relay <id|auto>, [inviteUri] or --invite <uri>, --name <this machine>, --yes, --no-wait, --json |
| peer status | Peers and connection paths at a glance | --json |
| peer trust | Pin or update a peer’s identity fingerprint | [nodeId], --json (TOFU confirmation) |
| peer leave | Leave the current network | --yes, --json |
Global options
| Option | Description |
|---|---|
| --json | Structured output (schema below) |
| --lang zh|en | Output language |
| --yes / -y | Skip confirmations (role switches, revocations) |
| --no-wait | Submit without waiting; commands wait for completion by default, so --no-wait reports submission rather than faking success |
| --socket <path> | Select a specific IPC socket (multi-instance setups) |
| --wait <seconds> | Maximum wait budget |
| --debug [outPath] | Attach a sanitized diagnostic report (default file zen-remote-debug-<role>-<timestamp>.json) |
status --json shape
With --debug an extra { ok, path, report } object is returned containing the full sanitized diagnostic. For other commands, --json echoes the operation result and affected entity (e.g. client pair returns the pairing entry; peer join returns admission state), or ok:false with a reason code on failure.
{
"experimental": true,
"role": "host | client | peer",
"pluginVersion": "3.0.1",
"pid": 12345,
"serverName": "my-machine",
// capability-gated sections appear as applicable:
"host": { /* local gateway / wizard / shared sessions (present when ping.serves is true, in both role=host and role=peer) */ },
"client": { "maxServers": 8, "servers": [ /* paired host rows */ ] },
"peer": { /* admission, discovery, connection paths (role=peer) */ }
}Configuration precedence & common fields
Environment > DSH plugin row > ~/.dsh/lan-gate.config.json > defaults; fields that require a gateway or push restart reload automatically on the plugin row. General env vars use the LAN_GATE_ prefix (e.g. LAN_GATE_MAX_SERVERS), while push notification env vars use DSH_PUSH_ (e.g. DSH_PUSH_ENABLED, DSH_PUSH_SUMMARY, DSH_PUSH_TURN_END, DSH_PUSH_TOOL, DSH_PUSH_EVENTS, DSH_PUSH_DEBOUNCE_MS, DSH_PUSH_SESSION_NAME).
| Field | Default | Purpose |
|---|---|---|
| role | host | Operating mode: host, client, or peer |
| serverName | Hostname | Display name (≤ 40 chars) for sidebar groups and pairing |
| port / host | 3088 / 127.0.0.1 | Gateway bind port and host (set 0.0.0.0 for LAN direct) |
| idleHours | 48 | Hours of inactivity before remote sharing auto-hibernates |
| autoShareNewSessions | false | Automatically share newly created host sessions |
| maxServers | 8 | Maximum paired hosts on Desktop Client (1–64, live reload) |
| pushEnabled / pushSummary | true / false | Master push switch and 120-char reply summary toggle |