Overview
The Longshot CLI provides a command-line interface for running the orchestrator with human-readable logs. It handles runtime resolution, log formatting, and optional dashboard integration.Installation
Basic Usage
Command Syntax
Arguments
request (required)
- Natural language build request
- Examples:
"Build Minecraft according to SPEC.md""Implement user authentication system""Add real-time chat feature"
Options
--dashboard
- Launch the Rich TUI dashboard alongside the orchestrator
- Shows real-time progress visualization
- Default: disabled
--reset
- Reset target repo to initial commit before running
- Executes
scripts/reset-target.sh - Useful for clean test runs
- Default: disabled
--debug
- Enable debug logging (LOG_LEVEL=debug)
- Shows verbose output with timestamps in milliseconds
- Increases truncate limits for error messages
- Default: disabled
--version
- Display CLI version and exit
Output Formatting
Log Levels
The CLI formats logs with color-coded levels:- DEBUG - Dim gray (only with
--debug) - INFO - Green
- WARN - Yellow
- ERROR - Red
Agent Styles
Different agents are color-coded:- planner - Cyan
- orchestrator - Magenta
- monitor - Blue
- worker-pool - Magenta
- reconciler - Yellow
- merge-queue - Blue
- llm-client - Dim
- main - White
Log Format
Metrics Bar
Real-time metrics displayed during execution:workers- Active workers (cyan)pending- Pending tasks (yellow)done- Completed tasks (green)failed- Failed tasks (red)commits/hr- Commits per hour rate (cyan)merged- Successfully merged branches (green)merge-q- Merge queue depth (yellow, if > 0)merge-fail- Failed merges (red, if > 0)tokens- Total tokens used (dim)in-flight- Estimated in-flight tokens (dim, if > 0)
Run Summary
Displayed at completion (success or interrupt):Runtime Resolution
The CLI automatically resolves the runtime:Local Development
If running from source with local build:Downloaded Runtime
Otherwise downloads and caches runtime bundle:- Cache location:
~/.longshot/runtime/{version}/ - Download from: GitHub releases
- Auto-install dependencies:
npm install --omit=dev
LONGSHOT_RUNTIME_URL- Override runtime download URLLONGSHOT_CACHE_DIR- Override cache directory (default:~/.longshot/runtime)LONGSHOT_RELEASE_REPO- Override GitHub repo (default:andrewcai8/longshot)LONGSHOT_PROMPTS_ROOT- Override prompts directory
Truncation Limits
The CLI truncates long data fields to keep logs readable:| Mode | Limit |
|---|---|
| Default | 200 chars |
| Error/Warn | 500 chars |
Debug (--debug) | 2000 chars |
Signal Handling
The CLI gracefully handles interrupt signals:- SIGINT (Ctrl+C) - Graceful shutdown with summary
- SIGTERM - Graceful shutdown with summary
- Display shutdown message
- Show run summary with metrics
- Terminate orchestrator process
- Terminate dashboard (if running)
- Exit
Exit Codes
- 0 - Orchestrator finished successfully
- Non-zero - Orchestrator error (displays error message)
- Script errors - Propagated from reset script
File Links
Log file paths are underlined for easy terminal navigation:Dashboard Integration
When--dashboard is enabled:
- CLI spawns dashboard process:
python dashboard.py --stdin - Pipes orchestrator stdout to dashboard stdin
- Dashboard renders TUI in parallel
- Both processes share the same log stream