CLI Reference

Complete reference for all NightShift commands. Every command is documented with flags, examples, and expected output.

nightshift solve

nightshift solve <problem.yaml> [--bg] [--dry-run] [--verbose]

Run a full autonomous solve from a problem YAML file. This is the primary command for complex, multi-step problems. The system reads the YAML, queries the Knowledge Base, assembles a team via AR, executes, evaluates, and writes results.

FlagDefaultDescription
--bgfalseRun in background. Detaches immediately and returns the process ID. Monitor with nightshift status.
--dry-runfalseSimulate the run without making LLM calls. Shows the planned agent team and estimated cost. Useful for checking budget before committing.
--verbosefalsePrint all agent messages to stdout in real time. Default behavior only shows summary lines.
--no-learnfalseDisable KB writes and AR updates for this run. Output is still produced. Use when testing or on sensitive data.
examples
# Standard solve
nightshift solve problem.yaml

# Background solve — useful for long-running tasks
nightshift solve problem.yaml --bg
✓ Run started (PID 14823). Monitor: nightshift status

# Dry run — see the plan before spending money
nightshift solve problem.yaml --dry-run
plan: researcher → analyst → writer → evaluator
ar: using pattern #7 (score 0.81, 14 runs)
estimated cost: $0.30 – $0.65

nightshift run

nightshift run <"natural language description"> [--bg]

Run a problem described in natural language. Shorter than solve — no YAML file needed. Useful for quick tasks. The system automatically generates acceptance criteria and budget estimates.

examples
nightshift run "fix the memory leak in worker.py"
nightshift run "write unit tests for auth/login.py"
nightshift run "analyze competitor pricing for SaaS tools under $50/mo"

nightshift status

nightshift status [--json] [--watch]

Show the current run state. Reads .nightshift/status.json and displays a human-readable summary. If no run is active, shows the last run's final state.

FlagDefaultDescription
--jsonfalseOutput raw status.json content. Useful for scripting or piping to jq.
--watchfalseContinuously refresh every 2 seconds. Press Ctrl+C to stop.
example output
nightshift status

phase: executing
nodes: researcher [done] analyst [running] writer [pending]
cost: $0.24 / $3.00 budget
attempt: 1 of 3
investor: exploit (confidence: medium)
auditor: anomalies=0, last event: node_done (analyst)

nightshift inject

nightshift inject <"message">

Send a message to the running system. The message is appended to .nightshift/inbox.jsonl, which the Auditor reads. At the next replan, the Coordinator receives it as part of the Auditor's consolidated summary.

Your hint is treated with the same weight as an Investor signal — neither has a veto, but both influence the Coordinator's next plan. Messages are most effective during the replan phase between attempts.

examples
# Send a strategic hint
nightshift inject "focus only on the US market, not global"

# Request a different approach
nightshift inject "the current approach is too broad, narrow it down"

# Provide missing context
nightshift inject "target audience: CTOs at companies with 50-200 employees"

✓ Message delivered to Auditor inbox

nightshift stop

nightshift stop [--force]

Send a graceful stop signal. Writes stop to .nightshift/control. The system finishes the currently running node, writes partial output if available, saves learning, and exits cleanly.

FlagDescription
--forceKill immediately without waiting for the current node. May produce incomplete output. Learning writes may be skipped.

nightshift history

nightshift history [--limit N] [--json]

Show past runs with quality scores, costs, and outcomes. Reads from episodic memory in the KB. Useful for understanding how the system has improved over time.

example output
nightshift history --limit 5

run #47 SWOT analysis quality=4/5 cost=$0.41 2m12s 2026-03-22
run #46 Fix auth bug quality=5/5 cost=$0.18 0m58s 2026-03-22
run #45 API performance audit quality=3/5 cost=$0.67 4m31s 2026-03-21
run #44 Competitor research quality=2/5 cost=$0.55 3m18s 2026-03-21
run #43 Write test suite quality=5/5 cost=$0.29 1m44s 2026-03-20

nightshift kb

nightshift kb <subcommand>

Manage the Knowledge Base directly. Subcommands: search, stats, clear.

examples
# Search the KB manually
nightshift kb search "authentication patterns"

# Show KB statistics
nightshift kb stats
local KB: 142 entries · 84KB · last write: 12m ago
global KB: 891 entries · 412KB · last write: 2h ago

# Clear local KB (keeps global)
nightshift kb clear --local