CLI Reference
The DeltaMind CLI provides operator handles for inspecting, debugging, and managing sessions from the terminal.
Installation
npm install @deltamind/cliOr run directly:
npx tsx packages/cli/src/index.ts <command>Working directory
The CLI searches upward from the current directory for a .deltamind/ directory (like Git searches for .git/). This directory contains snapshot.json and provenance.jsonl.
Global flags
| Flag | Effect |
|---|---|
--json | Machine-readable JSON output (most commands) |
--help | Show usage |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Usage error (bad arguments, missing required flags) |
| 2 | Missing or corrupt .deltamind/ directory |
Commands
deltamind inspect
Show active state grouped by kind. Uses the renderActiveState() projection.
deltamind inspect # Full state overviewdeltamind inspect --kind goal # Only goalsdeltamind inspect --json # Machine outputdeltamind export
Export budgeted working-set text or ai-loadout JSON.
deltamind export # Context text (default 4000 chars)deltamind export --max-chars 2000 # Smaller budgetdeltamind export --for ai-loadout # ai-loadout session layer JSONdeltamind export --json # Full export objectdeltamind changed --since <value>
Show what changed since a given point. The --since value is interpreted as:
- ISO timestamp (contains “T” or starts with YYYY-): compared against
lastTouched - Sequence number (pure integer): looks up the timestamp from
deltaLog[seq] - Turn ID (starts with “t-”): finds the earliest delta with that source turn
deltamind changed --since 5 # Since seq 5deltamind changed --since t-12 # Since turn t-12deltamind changed --since 2026-03-11T10:00:00.000Z # Since timestampdeltamind changed --since 5 --json # Machine outputOutput is grouped by kind.
deltamind explain <item-id>
Deep-dive on a single item. Shows:
- Item fields (id, semanticId, kind, summary, status, confidence, source turns, tags)
- Delta history — all deltas in the log referencing this item (by id or targetId)
- Provenance events — accepted/rejected events for this item
deltamind explain item-3 # Full detaildeltamind explain item-3 --json # Machine outputThis is the debugging command. When something looks wrong in state, explain shows exactly how the item got there.
deltamind replay
Walk the provenance log chronologically.
deltamind replay # All eventsdeltamind replay --since 10 # Events from seq 10 onwarddeltamind replay --type accepted # Only accepted deltasdeltamind replay --type rejected # Only rejectionsdeltamind replay --type checkpoint # Only checkpointsdeltamind replay --json # Machine outputOutput format:
seq 3 ACCEPTED decision_made item-3: "Use Fastify for the backend"seq 3 REJECTED decision_revised "Relax constraint" — target not foundseq 5 CHECKPOINT items:7 deltas:12 turns:35deltamind suggest-memory
Show advisory memory update suggestions.
deltamind suggest-memory # All suggestionsdeltamind suggest-memory --min-confidence high # Only high-confidencedeltamind suggest-memory --include-superseded # Include superseded itemsdeltamind suggest-memory --json # Machine outputEach suggestion includes the action (create/update), item reference, rendered memory file with frontmatter, and confidence reasoning.
deltamind save
Persist the current session to .deltamind/.
deltamind save # Save to .deltamind/ (creates if needed)deltamind save --from-stdin # Initialize from a piped snapshot--from-stdin reads a JSON snapshot from stdin:
cat snapshot.json | deltamind save --from-stdindeltamind resume
Load a session and show health stats.
deltamind resume # Human-readable summarydeltamind resume --json # Machine outputOutput:
Session loaded from /path/to/.deltamind
Sequence: 12Items: 7Deltas: 15Turns: 35Processed: 3 batchesDecisions: 2 activeConstraints: 3 activeTasks: 1 openPipe-friendly design
- stdout — data output (command results, JSON). Pipe-safe.
- stderr — diagnostics and error messages. Separated from data.
- No ANSI colors — output is plain text. Won’t corrupt pipes or log files.
- JSON mode — every command supports
--jsonfor machine consumption.