CLI Reference
All commands are deterministic. Validation uses embedded schemas.
Quick Reference
| Command | Purpose | Modifies State |
|---|---|---|
explore | Search codebase, symbols, call graphs | No |
store | Store idea/decision/learning | Yes |
recall | Search and retrieve knowledge | No |
status | Show workspace status and stats | No |
init | Initialize .palace/ structure | Yes |
index | Manage code index (scan, check, stats) | Yes |
serve | Start MCP server | No |
lsp | Start LSP server for editors | No |
session | Manage agent sessions | Yes |
corridor | Cross-workspace sharing | Varies |
clean | Cleanup stale data | Yes |
update | Self-update to latest | Yes |
version | Show version info | No |
help | Show help for commands | No |
Core Commands
explore
Search the codebase, symbols, and call graphs.
palace explore "<query>" [options]
palace explore --map <symbol> [options]
palace explore --roomsOptions:
| Flag | Description |
|---|---|
--room <name> | Filter to specific room |
--rooms | List all configured rooms |
--limit <n> | Maximum results (default: 10) |
--fuzzy | Enable fuzzy matching |
--full | Get full context (generates context-pack.json) |
--map <symbol> | Trace call graph for a symbol or file |
--file <path> | File path for --map mode |
--depth <n> | Recursion depth for call chain (1-10) |
--direction <d> | Trace direction: up, down, or both |
Note: Flags can appear before or after the query (e.g., palace explore "auth" --full).
Entry Point Detection: When tracing calls for entry points like main, init, Test*, or handlers, the tool explains these are called by the runtime rather than showing “no callers found”.
store
Store ideas, decisions, and learnings (auto-classified).
palace store "<content>" [options]Options:
| Flag | Description |
|---|---|
--as <type> | Force type: decision, idea, learning |
--scope <scope> | Scope: file, room, palace (default: palace) |
--path <path> | Scope path for file/room scope |
--confidence <n> | Confidence for learnings, 0.0-1.0 (default: 0.5) |
--tag <tags> | Comma-separated tags |
Auto-Classification: Content is classified based on natural language signals:
- “Let’s use…”, “We should…”, “Decision:” → decision (95%+ confidence)
- “What if…”, “Maybe…”, “Idea:” → idea
- “TIL…”, “Always…”, “Note:” → learning
Input Validation: Ambiguous input (less than 40% confidence with no signals) is rejected with helpful tips.
recall
Search and retrieve knowledge.
palace recall [query] [options]
palace recall <type> # Shorthand: decisions, ideas, learnings
palace recall update <id> <outcome>
palace recall link --<rel> <target> <source>Options:
| Flag | Description |
|---|---|
--type <type> | Filter by type: decision, idea, learning |
--scope <scope> | Filter by scope: file, room, palace |
--path <path> | Filter by scope path |
--pending | Show decisions awaiting outcome |
--limit <n> | Maximum results (default: 10) |
Type Shortcuts: First argument can be a type name:
palace recall decisions→ same as--type decisionpalace recall ideas→ same as--type ideapalace recall learnings→ same as--type learning
Subcommands:
update <id> <outcome>: Record decision outcome (success,failed,mixed)link --<rel> <target> <source>: Create relationships between records (flags before source ID)
brief
Get file briefing and intelligence.
palace brief <file-path> [options]Options:
| Flag | Description |
|---|---|
--sessions | Include recent agent activity details |
Setup & Indexing
init
Initialize the palace in the current directory.
palace init [options]Options:
| Flag | Description |
|---|---|
--detect | Auto-detect project type and generate rooms |
--with-outputs | Also create generated output templates |
--force | Overwrite existing curated files |
scan
Build or refresh the Index (Tier-0).
palace scan [options]Options:
| Flag | Description |
|---|---|
--full | Force full rescan (default: incremental) |
--deep | Enable LSP-based deep analysis |
Parses files using Tree-sitter and stores symbols in SQLite. For Dart/Flutter projects, deep analysis runs automatically to extract accurate call relationships via LSP.
check
Verify Index freshness and validate schemas.
palace check [options]Options:
| Flag | Description |
|---|---|
--strict | Hash all files (slower but thorough) |
--diff <range> | Scope check to a specific git diff range |
--collect | Also generate context pack from diff |
--signal | Also generate change signal from diff |
Services
lsp
Start the Language Server Protocol server for editor integration.
palace lsp [options]Options:
| Flag | Description |
|---|---|
--root <path> | Workspace root directory (default: current directory) |
--log <file> | Log file path (logs to file instead of stderr) |
The LSP server provides:
- Real-time pattern violation diagnostics
- Contract mismatch detection
- Hover information for patterns and contracts
- Code actions (approve, ignore, verify)
- Code lens showing issue counts
Typically started automatically by the VS Code extension. See LSP Server for details.
Maintenance
clean
Cleanup stale sessions, agents, and old learnings.
palace clean [--dry-run]Performs the following maintenance tasks:
- Sessions: Marks sessions inactive for >24h as abandoned
- Agents: Removes agents with no heartbeat for >5 minutes
- Learnings: Decays confidence of learnings unused for >30 days
- Pruning: Removes learnings with confidence below 0.1
- Corridor Links: Validates and removes stale workspace links
Shows status for each category even when nothing needs cleanup.