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 / flag | What 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 --simulator | Watches 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 60s | Simulator auto-fault cadence (default 60s; pass 0 for manual console triggers only). |
--addr 127.0.0.1:8000 | Loopback bind address for the embedded local console. Non-loopback addresses are rejected. |
--no-ui | Run headless without starting the HTTP console server. |
--from-start | With --source <file>, process existing file contents from line 1 instead of tailing from EOF. |
--dry-run | Decide 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 --version | Print the installed Nightwatch CLI version. |
Policy
| Command | What 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
| Command | What 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 outbox | Lists queued, sent, deferred, and suppressed pages. |
nightwatch page flush | Attempts 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).
| Command | What it does |
nightwatch query [--json] "<sql>" | Runs a read-only ClickHouse SQL query against ~/.nightwatch/audit. |
nightwatch audit verify | Verifies the SHA-256 hash chain across all triage records. |
nightwatch report export --since 30d --out ./report.csv | Exports redacted triage records to CSV (zero raw log text). |
Environment variables
| Variable | Meaning |
NIGHTWATCH_HOME | Directory holding policy.yaml, audit/, bin/, and lib/. Default ~/.nightwatch. |
OLLAMA_HOST | Local Ollama loopback URL. Default http://127.0.0.1:11434 (non-loopback rejected). |
CHDB_LIB_PATH | Explicit path to libchdb.so if not in ~/.nightwatch/lib/. |
VONAGE_API_KEY, VONAGE_API_SECRET | Enable SMS paging and Verify v2 2FA through Vonage. |
NIGHTWATCH_ONCALL_NUMBER | On-call phone in E.164 format (masked in output, never stored in audit rows). |
VONAGE_APPLICATION_ID, VONAGE_PRIVATE_KEY, VONAGE_VOICE_FROM | Optional: enable Vonage Voice API TTS calls for unacknowledged BLOCK/CRITICAL pages. |
NIGHTWATCH_VONAGE=0 | Force paging off even when Vonage credentials are exported. |
NIGHTWATCH_MODEL, NIGHTWATCH_MODEL_DIR, NIGHTWATCH_MODEL_BASE_URL, NIGHTWATCH_NO_PATH_LINK=1 | Installer overrides: pin tier (default|balanced|small|tiny|all), use local GGUF folder, override the Hugging Face mirror URL, or skip PATH symlinking. |