CLI Reference
The CLI provides an interactive REPL for conversing with Maestro.
Starting the CLI
Section titled “Starting the CLI”# Developmentnpm run cli
# Productionnode dist/index.js cliCommands
Section titled “Commands”All commands start with /:
| Command | Description |
|---|---|
/help | Show available commands |
/clear | Clear conversation history for current session |
/cost | Show token usage and estimated cost |
/quit | Exit the CLI |
/exit | Exit the CLI (alias) |
Usage Examples
Section titled “Usage Examples”Basic Conversation
Section titled “Basic Conversation”$ npm run cli
Maestro CLI - Type /help for commands, /quit to exit
You: Hello!Assistant: Hello! How can I help you today?
You: What's 15% tip on $85?Assistant: 15% of $85 = $12.75
You: /costToken usage: Input: 245 tokens Output: 52 tokens Estimated cost: $0.0012
You: /quitGoodbye!Using Tools
Section titled “Using Tools”You: Clone https://github.com/example/projectAssistant: Cloned to project. This is now your active project.
You: What files are in this project?Assistant: [Uses claude_code to list files]- README.md- package.json- src/ - index.ts - utils.tsCreating Agents
Section titled “Creating Agents”You: Create an agent called summarizerAssistant: Created summarizer. What should its description be?
You: It summarizes long texts conciselyAssistant: Updated description. What system prompt should it use?
You: Be extremely concise. Summarize to 2-3 sentences max.Assistant: Updated system prompt. summarizer is ready.
You: List all agentsAssistant: Available agents:- orchestrator- personal-assistant- coder- summarizer (dynamic)Session Persistence
Section titled “Session Persistence”The CLI uses a fixed session ID per terminal. Your conversation history:
- Persists across CLI restarts
- Is stored in SQLite (
data/maestro.db) - Can be cleared with
/clear
Keyboard Shortcuts
Section titled “Keyboard Shortcuts”| Shortcut | Action |
|---|---|
Ctrl+C | Cancel current input |
Ctrl+D | Exit CLI |
Up/Down | Navigate history |
Output Formatting
Section titled “Output Formatting”The CLI supports:
- Colored output for different message types
- Streaming responses (text appears as it’s generated)
- Markdown rendering in terminal
Environment Variables
Section titled “Environment Variables”The CLI respects these environment variables:
| Variable | Effect |
|---|---|
LOG_LEVEL | Set logging verbosity |
NO_COLOR | Disable colored output |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Normal exit |
| 1 | Error occurred |
Troubleshooting
Section titled “Troubleshooting”CLI hangs on startup
Section titled “CLI hangs on startup”Check that ANTHROPIC_API_KEY is set in .env.
No streaming output
Section titled “No streaming output”Some terminals don’t support streaming. The response will appear all at once when complete.
History not working
Section titled “History not working”Arrow key history requires a compatible terminal. Most modern terminals support this.