CLI
PanCode provides a command-line interface for session management and orchestrator configuration.
Commands
Section titled “Commands”pancode
Section titled “pancode”Start a new PanCode tmux session.
pancodepancode --preset localpancode --model localhost-ollama/llama3.2 --safety full-autoCreates a tmux session named pancode-<hash> (where hash is the first 6 characters of the SHA-256 digest of the working directory) and attaches to it. Each project gets its own session namespace. Multiple sessions can coexist.
If a session already exists for the current directory, a new one is created with an incrementing suffix: pancode-a3f2b1-2, pancode-a3f2b1-3, etc.
pancode up
Section titled “pancode up”Attach to an existing PanCode tmux session.
pancode up # Attach to most recent sessionpancode up pancode-a3f2b1 # Attach to specific session by nameIf the session is already attached in another terminal, the command fails with a message.
pancode down
Section titled “pancode down”Stop PanCode tmux sessions.
pancode down # Stop most recent sessionpancode down pancode-a3f2b1 # Stop specific sessionpancode down --all # Stop all PanCode sessionsShutdown is graceful: PanCode sends Ctrl+C to trigger the ShutdownCoordinator, waits up to 5 seconds for clean exit, then force-kills if needed. This gives workers time to receive SIGTERM and flush state.
pancode sessions
Section titled “pancode sessions”List all running PanCode tmux sessions.
pancode sessionsOutput:
2 sessions:
pancode-a3f2b1 detached pancode-7e4c89 attachedpancode version
Section titled “pancode version”Print the PanCode version number.
pancode version# 0.3.0pancode login
Section titled “pancode login”Display instructions for in-shell provider authentication.
pancode login# Use /login inside the PanCode shell to authenticate with providers.pancode reset
Section titled “pancode reset”Clear runtime state while preserving user configuration.
pancode resetCleared:
.pancode/runs.json,metrics.json,budget.json,tasks.json.pancode/runtime/(board.json, worker results)~/.pancode/agent-engine/sessions/
Preserved:
~/.pancode/panpresets.yaml~/.pancode/panagents.yaml~/.pancode/panproviders.yaml~/.pancode/settings.json~/.pancode/agent-engine/auth.json
Orchestrator Flags
Section titled “Orchestrator Flags”These flags are passed to the orchestrator process when starting a new session. They can be combined with the base pancode command.
| Flag | Argument | Description |
|---|---|---|
--preset <name> | Preset name | Apply a boot preset (local, openai, openai-max, hybrid) |
--cwd <path> | Directory path | Working directory for the session |
--provider <name> | Provider name | Preferred provider for model resolution |
--model <id> | Model reference | Model override in provider/model-id format |
--profile <name> | Profile name | Config profile name |
--safety <level> | Safety level | suggest, auto-edit, or full-auto |
--theme <name> | Theme name | TUI theme name |
--rediscover | (none) | Force full engine discovery, ignoring cache |
--fresh | (none) | Clear runtime state before boot |
--help | (none) | Show usage information |
Flag Precedence
Section titled “Flag Precedence”CLI flags override preset values. If you specify both --preset local and --safety full-auto, the safety level from the flag wins.
Priority: CLI flag > preset value > environment variable > project config > global config > default.
Examples
Section titled “Examples”# Start with local presetpancode --preset local
# Override model from presetpancode --preset local --model dynamo-lmstudio/qwen2.5-coder-32b
# Fresh start with full-auto safetypancode --fresh --safety full-auto
# Force rediscovery on a specific projectpancode --cwd /path/to/project --rediscover
# Show helppancode --helpSession Naming
Section titled “Session Naming”Session names use a project-specific hash to prevent collisions:
pancode-<hash> # First session for a projectpancode-<hash>-2 # Second session for same projectpancode-<hash>-3 # Third sessionThe hash is the first 6 hex characters of the SHA-256 digest of the working directory path.
tmux Integration
Section titled “tmux Integration”PanCode auto-configures tmux extended-keys for proper key handling:
extended-keys = onextended-keys-format = csi-uThis enables keyboard shortcuts like Alt+A and Ctrl+Y to work correctly. The configuration is applied globally on session creation and silently fails on older tmux versions.
See Also
Section titled “See Also”- Quick Start: First-time usage walkthrough
- Configuration Guide: Config resolution details
- Keyboard Shortcuts: All keyboard shortcuts