Reference / CLI

CLI reference

Everything the nightwatch command can do, in one place. Add --help to any command to see all its options.

Run & triage

Command / flagWhat it does
nightwatch doctor [--model <tag>]Checks Ollama, the specialist model, embedded ClickHouse, the policy file, and Vonage paging.
nightwatch models [--json]Lists all four published Hugging Face specialists, shows which are installed locally in Ollama, and prints exact install commands.
nightwatch run --simulatorWatches the built-in calm station simulator and serves http://127.0.0.1:8000.
nightwatch run --source <file|-> --station <name>Follows a real log file, or reads stdin (--source -) so you can pipe journalctl -f.
--interval 60sSimulator auto-fault cadence (default 60s; pass 0 for manual console triggers only).
--addr 127.0.0.1:8000Loopback bind address for the embedded local console. Non-loopback addresses are rejected.
--no-uiRun headless without starting the HTTP console server.
--from-startWith --source <file>, process existing file contents from line 1 instead of tailing from EOF.
--dry-runDecide and record in ClickHouse, but never execute actions or send pages.
--model <tag>Use a specific specialist model tag instead of automatic detection.
--policy <path>Override the policy file path (default ~/.nightwatch/policy.yaml).
nightwatch triage [--json] [--model <tag>] <file|->Decide on a single saved (or piped) log window and print the redacted result.
nightwatch --versionPrint the installed Nightwatch CLI version.

Policy

CommandWhat it does
nightwatch policy check [--policy <path>]Validates policy.yaml and prints tool / protected-service counts.
nightwatch policy test [--since 24h] [--policy <path>]Replays recorded incidents against the current policy and shows every lane change.

Paging

CommandWhat it does
nightwatch page doctor [--online]Checks Vonage credentials, and with --online verifies account balance.
nightwatch page preview [--station <name>]Prints every GSM-7 zero-PII page template offline with character counts.
nightwatch page outboxLists queued, sent, deferred, and suppressed pages.
nightwatch page flushAttempts immediate delivery of due queued pages.
nightwatch page ack <ref>Acknowledges a BLOCK/CRITICAL alert and cancels any pending voice escalation call.

Data & audit

All data commands are lock-safe: if nightwatch run is already holding the embedded ClickHouse lock, the CLI automatically proxies read-only queries over 127.0.0.1:8000 (override with --daemon).

CommandWhat it does
nightwatch query [--json] "<sql>"Runs a read-only ClickHouse SQL query against ~/.nightwatch/audit.
nightwatch audit verifyVerifies the SHA-256 hash chain across all triage records.
nightwatch report export --since 30d --out ./report.csvExports redacted triage records to CSV (zero raw log text).

Environment variables

VariableMeaning
NIGHTWATCH_HOMEDirectory holding policy.yaml, audit/, bin/, and lib/. Default ~/.nightwatch.
OLLAMA_HOSTLocal Ollama loopback URL. Default http://127.0.0.1:11434 (non-loopback rejected).
CHDB_LIB_PATHExplicit path to libchdb.so if not in ~/.nightwatch/lib/.
VONAGE_API_KEY, VONAGE_API_SECRETEnable SMS paging and Verify v2 2FA through Vonage.
NIGHTWATCH_ONCALL_NUMBEROn-call phone in E.164 format (masked in output, never stored in audit rows).
VONAGE_APPLICATION_ID, VONAGE_PRIVATE_KEY, VONAGE_VOICE_FROMOptional: enable Vonage Voice API TTS calls for unacknowledged BLOCK/CRITICAL pages.
NIGHTWATCH_VONAGE=0Force paging off even when Vonage credentials are exported.
NIGHTWATCH_MODEL, NIGHTWATCH_MODEL_DIR, NIGHTWATCH_MODEL_BASE_URL, NIGHTWATCH_NO_PATH_LINK=1Installer overrides: pin tier (default|balanced|small|tiny|all), use local GGUF folder, override the Hugging Face mirror URL, or skip PATH symlinking.