CLI Reference
Complete reference for all BobaMixer command-line interface commands and options.
Global Options
These options are available for all commands:
--help, -h Show help message
--version, -v Show version information
--verbose Enable verbose output
--quiet Suppress non-error output
--no-color Disable colored output
--config PATH Custom config directory (default: ~/.boba)Commands
boba
Launch the interactive TUI dashboard.
boba [options]Options:
--profile PROFILE- Start with specific profile--refresh-rate SECONDS- Dashboard refresh rate (default: 5)
Example:
# Launch dashboard
boba
# Launch with specific profile
boba --profile claude-sonnet
# Faster refresh
boba --refresh-rate 2boba doctor
Check configuration health and diagnose issues.
boba doctor [options]Options:
--verbose- Show detailed diagnostics--fix- Attempt to fix common issues
Checks performed:
- Configuration file syntax
- File permissions (especially secrets.yaml)
- Database connectivity
- API endpoint accessibility
- Profile validity
- Secret references
Example:
# Basic health check
boba doctor
# Detailed diagnostics
boba doctor --verbose
# Auto-fix issues
boba doctor --fixOutput:
BobaMixer Health Check
───────────────────────────────────────
✓ Configuration directory exists
✓ Database accessible
✓ Secrets file permissions correct (0600)
✓ All profiles valid
✓ 3 profiles configured
✗ Warning: 2 profiles missing pricing info
✓ API endpoints reachable
Status: Healthy with warningsboba use
Set the active profile.
boba use PROFILEArguments:
PROFILE- Name of the profile to activate
Example:
# Activate profile
boba use claude-sonnet
# Verify active profile
boba ls --currentboba ls
List profiles, projects, or sessions.
boba ls [options]Options:
--profiles- List all profiles--projects- List all projects--sessions- List recent sessions--current- Show current active profile--tag TAG- Filter by tag--verbose- Show detailed information
Example:
# List all profiles
boba ls --profiles
# Current profile
boba ls --current
# Profiles with specific tag
boba ls --profiles --tag work
# Detailed profile info
boba ls --profiles --verboseOutput:
Configured Profiles
───────────────────────────────────────
Name Adapter Model Tags
claude-sonnet http claude-3-5-sonnet-20241022 [work, complex]
gpt-4o-mini http gpt-4o-mini [fast, cheap]
local-llama tool llama2 [local, free]
Active: claude-sonnet
Total: 3 profilesboba stats
View usage statistics.
boba stats [options]Time Range Options:
--today- Today's statistics--yesterday- Yesterday's statistics--7d- Last 7 days--30d- Last 30 days--from DATE --to DATE- Custom date range (YYYY-MM-DD)
Breakdown Options:
--by-profile- Group by profile--by-project- Group by project--by-session- Group by session--by-estimate- Group by estimate accuracy level
Additional Options:
--compare- Compare profiles (with --by-profile)--latency- Show latency statistics--percentiles- Show latency percentiles (P50, P95, P99)--trend PERIOD- Show trend (daily|weekly)--breakdown- Detailed cost breakdown--sort-by FIELD- Sort by field (cost|requests|tokens|latency)
Example:
# Today's stats
boba stats --today
# Last 7 days by profile
boba stats --7d --by-profile
# Compare profile performance
boba stats --7d --by-profile --compare
# Latency analysis
boba stats --7d --latency --percentiles
# Custom date range
boba stats --from 2024-01-01 --to 2024-01-31
# Project breakdown
boba stats --30d --by-project
# Cost breakdown
boba stats --7d --breakdownboba route
Manage and test routing rules.
boba route SUBCOMMAND [options]Subcommands:
test TEXT- Test routing with text or filelist- List all routing rulesvalidate- Validate routing configuration
Test Options:
@FILE- Test with file content--verbose- Show detailed evaluation--explain- Explain matching process
Example:
# Test with text
boba route test "Write a sorting function"
# Test with file
boba route test @prompts/example.txt
# Verbose output
boba route test --verbose "Format this code"
# List all rules
boba route list
# Validate config
boba route validateTest Output:
Routing Test
───────────────────────────────────────
Input: "Write a sorting function"
Input Length: 1,234 characters
Matched Rule: code-generation
Condition: text.matches('write.*function|implement')
Profile: code-specialist
Fallback: general-purpose
Reason: Code generation task
Would use profile: code-specialistboba budget
Manage budgets and view spending.
boba budget [options]View Options:
--status- Show budget status--detailed- Detailed budget breakdown--project NAME- Specific project budget
Set Options:
--set TYPE AMOUNT- Set budget (daily|weekly|monthly|cap)--project NAME- Set project-specific budget
Projection Options:
--project PERIOD- Project spending (daily|weekly|monthly)
Example:
# View status
boba budget --status
# Detailed view
boba budget --status --detailed
# Project budget
boba budget --status --project my-app
# Set daily budget
boba budget --set daily 50
# Set project budget
boba budget --set daily 10 --project my-app
# Set hard cap
boba budget --set cap 1000
# View projection
boba budget --project monthlyboba action
View and manage alerts and suggestions.
boba action [options]Options:
--type TYPE- Filter by type (budget|suggestion|alert)apply ID- Apply a suggestiondismiss ID- Dismiss an actionpreview ID- Preview before applying
Example:
# View all actions
boba action
# Budget alerts only
boba action --type budget
# Apply suggestion
boba action apply suggestion-123
# Preview first
boba action preview suggestion-123
# Dismiss action
boba action dismiss alert-456Output:
Pending Actions
───────────────────────────────────────
ID: budget-alert-001
Type: Budget Warning
Priority: Medium
Message: Daily budget at 78% ($7.80 / $10.00)
ID: suggestion-001
Type: Optimization Suggestion
Priority: Low
Message: Switch to 'gpt-4o-mini' for simple tasks
Potential Savings: $15.20/week (32%)
Confidence: 85%
Action: boba action apply suggestion-001boba report
Export usage data.
boba report [options]Format Options:
--format FORMAT- Export format (json|csv)--output FILE- Output file path
Filter Options:
--from DATE --to DATE- Date range--profile PROFILE- Specific profile--project PROJECT- Specific project
Example:
# Export to JSON
boba report --format json --output usage.json
# Export to CSV
boba report --format csv --output usage.csv
# Last 30 days
boba report --format json --from $(date -d '30 days ago' +%Y-%m-%d) --output last-month.json
# Specific profile
boba report --format csv --profile claude-sonnet --output claude-usage.csv
# Specific project
boba report --format json --project my-app --output my-app-usage.jsonboba session
Manage and view sessions.
boba session SUBCOMMAND [options]Subcommands:
list- List sessionsshow ID- Show session detailsdelete ID- Delete a session
List Options:
--today- Today's sessions--7d- Last 7 days--30d- Last 30 days--project PROJECT- Filter by project
Example:
# List recent sessions
boba session list --7d
# Show session details
boba session show session-123
# Today's sessions
boba session list --today
# Project sessions
boba session list --project my-app --30dboba edit
Edit configuration files.
boba edit CONFIGArguments:
profiles- Edit profiles.yamlroutes- Edit routes.yamlpricing- Edit pricing.yamlsecrets- Edit secrets.yaml
Example:
# Edit profiles
boba edit profiles
# Edit routing rules
boba edit routes
# Edit pricing config
boba edit pricing
# Edit secrets
boba edit secretsOpens configuration file in $EDITOR (defaults to vim/nano).
boba hooks
Manage git hooks integration.
boba hooks SUBCOMMAND [options]Subcommands:
install- Install git hooks in current repositoryremove- Remove git hooksstatus- Show hook installation status
Install Options:
--force- Overwrite existing hooks
Example:
# Install hooks in current repo
cd my-project
boba hooks install
# Force reinstall
boba hooks install --force
# Check status
boba hooks status
# Remove hooks
boba hooks removeboba version
Show version information.
boba version [options]Options:
--check-update- Check for newer version
Example:
# Show version
boba version
# Check for updates
boba version --check-updateOutput:
BobaMixer v1.2.3
Commit: abc1234
Built: 2024-01-15T10:30:00Z
Go Version: go1.22.0
Update available: v1.3.0
Run: brew upgrade bobamixerEnvironment Variables
# Custom config directory
export BOBA_HOME=/custom/path
# Log level (trace|debug|info|warn|error)
export BOBA_LOG_LEVEL=debug
# Custom database path
export BOBA_DB_PATH=/custom/usage.db
# Editor for boba edit
export EDITOR=vim
# Disable colors
export NO_COLOR=1
# Force TTY mode
export BOBA_FORCE_TTY=1
# API timeout (seconds)
export BOBA_API_TIMEOUT=30Exit Codes
0 # Success
1 # General error
2 # Configuration error
3 # Database error
4 # API error
5 # Permission error
10 # User cancelledShell Completion
Bash
# Add to ~/.bashrc
eval "$(boba completion bash)"
# Or generate to file
boba completion bash > /etc/bash_completion.d/bobaZsh
# Add to ~/.zshrc
eval "$(boba completion zsh)"
# Or generate to file
boba completion zsh > "${fpath[1]}/_boba"Fish
# Generate completion
boba completion fish > ~/.config/fish/completions/boba.fishCommon Workflows
Daily Usage Check
# Morning routine
boba stats --yesterday
boba budget --status
boba action
# If alerts exist
boba action apply <id>Profile Switching
# List available
boba ls --profiles
# Switch
boba use <profile>
# Verify
boba ls --currentWeekly Review
# View stats
boba stats --7d --by-profile
# Export for analysis
boba report --format csv --7d --output weekly-$(date +%Y-%m-%d).csv
# Check budget
boba budget --status --detailedTesting Routing
# Create test cases
mkdir route-tests
echo "Generate code" > route-tests/gen.txt
echo "Review code" > route-tests/review.txt
# Test all
for f in route-tests/*.txt; do
boba route test @"$f"
doneBudget Management
# Check status
boba budget --status
# View projection
boba budget --project monthly
# Adjust if needed
boba budget --set daily 60
# Apply optimizations
boba action --type suggestion
boba action apply <id>Tips and Tricks
Quick Stats
# Alias for quick checks
alias bs='boba stats'
alias bst='boba stats --today'
alias bs7='boba stats --7d --by-profile'Budget Monitoring
# Daily cron job
0 9 * * * boba budget --status | mail -s "Daily BobaMixer Budget" you@example.comAuto-Export
# Weekly export
0 0 * * 0 boba report --format csv --7d --output ~/reports/boba-$(date +%Y-%m-%d).csvProfile Quick Switch
# Functions in ~/.bashrc
fast() { boba use fast-model; }
quality() { boba use quality-model; }
cheap() { boba use economical-model; }JSON Processing
# Install jq for JSON processing
brew install jq
# Find expensive requests
boba report --format json | jq 'select(.cost_usd > 1.0)'
# Top 10 by cost
boba report --format json | jq 'sort_by(.cost_usd) | reverse | .[0:10]'
# Group by profile
boba report --format json | jq 'group_by(.profile) | map({profile: .[0].profile, total: map(.cost_usd) | add})'Troubleshooting Commands
Configuration Issues
# Full diagnostic
boba doctor --verbose
# Check specific config
cat ~/.boba/profiles.yaml
yamllint ~/.boba/profiles.yamlDatabase Issues
# Check database
sqlite3 ~/.boba/usage.db "PRAGMA integrity_check;"
# Vacuum
sqlite3 ~/.boba/usage.db "VACUUM;"
# Analyze
sqlite3 ~/.boba/usage.db "ANALYZE;"Permission Issues
# Fix secrets permissions
chmod 600 ~/.boba/secrets.yaml
# Fix directory permissions
chmod 700 ~/.bobaAPI Issues
# Test connectivity
boba doctor
# Enable debug logging
export BOBA_LOG_LEVEL=debug
boba route test "test"
# Check logs
tail -f ~/.boba/logs/boba.logNext Steps
- Configuration Files Reference - Detailed config schemas
- Getting Started - Basic usage guide
- Troubleshooting - Common issues