CLI Commands Reference
CAMI provides a command-line interface for agent management operations. While the MCP server (natural language with Claude) is the primary interface, the CLI is useful for scripting, CI/CD pipelines, and direct terminal usage.
Quick Reference
# Core commandscami --mcp # Start MCP server (primary interface)cami list # List available agentscami deploy # Deploy agents to projectcami scan # Scan deployed agentscami update-docs # Update CLAUDE.md# Source managementcami source add <git-url> # Add agent sourcecami source list # List sourcescami source update [name] # Update sources (git pull)cami source status # Show git statuscami source remove <name> # Remove source# Location managementcami locations # List locationscami location add -n <name> -p <path>cami location remove -n <name># Help and infocami --help # Show helpcami --version # Show versioncami <command> --help # Command-specific helpCore Commands
cami --mcp
Purpose: Start CAMI as an MCP server for Claude Code integration.
Usage:
cami --mcpWhen to Use:
- Claude Code integration (configured in
~/.config/claude/mcp.json) - Automatic startup by Claude Code
- Never run manually (Claude manages the process)
How It Works:
- Loads configuration from
~/cami-workspace/config.yaml - Initializes MCP server with stdio transport
- Registers all 19 MCP tools
- Waits for tool calls from Claude Code
- Logs to stderr for debugging
Configuration:
In ~/.config/claude/mcp.json:
{ "mcpServers": { "cami": { "command": "cami", "args": ["--mcp"] } }}Output: None (runs as background server until Claude Code exits)
Troubleshooting:
- No output: Normal behavior (stdio used for MCP protocol)
- Logs: Check Claude Code's MCP console
- Errors: Logged to stderr, visible in Claude Code
See Also:
- MCP Tools API Reference - Available tools
- Getting Started - Setup guide
cami list
Purpose: List all available agents from configured sources.
Usage:
cami listOutput Example:
Available agents (12 total):## Core (3 agents)• architect (v3.2.0) Expert application architect specializing in system design• backend (v2.1.0) Back-end specialist for Node.js and API development• frontend (v2.0.1) Front-end specialist for React and modern web UIs## Specialized (2 agents)• designer (v1.1.0) Visual design and UI/UX specialist• qa (v1.0.0) Quality assurance and testing specialistDetails:
- Groups agents by category (from folder structure)
- Shows name, version, and description
- Uses priority-based deduplication (lowest priority number wins)
- Requires configured sources (
cami source addfirst)
Error Conditions:
- No sources configured: Error with setup instructions
- Sources exist but no agents found: Empty list with warning
See Also:
cami source list- View configured sourcescami scan- Check deployed versions
cami deploy
Purpose: Deploy selected agents to a project directory.
Usage:
cami deploy --agents <names> --location <path> [--overwrite]cami deploy -a <names> -l <path> [-o]Parameters:
-a, --agents <names>- Comma-separated agent names (required)-l, --location <path>- Target project path (required)-o, --overwrite- Replace existing agents (default: false)--output <format>- Output format: text or json (default: text)
Examples:
Basic deployment:
cami deploy -a frontend,backend -l ~/projects/my-appOutput:
Deployment Results: ✓ frontend: Deployed successfully ✓ backend: Deployed successfullySummary: Deployed: 2With overwrite:
cami deploy -a frontend -l ~/projects/my-app --overwriteJSON output:
cami deploy -a frontend,backend -l ~/projects/my-app --output jsonOutput:
{ "success": true, "deployed": ["frontend", "backend"], "failed": [], "conflicts": [], "results": [ { "agent": "frontend", "status": "success", "message": "Deployed successfully" }, { "agent": "backend", "status": "success", "message": "Deployed successfully" } ]}Conflict Handling:
When agent already exists and overwrite=false:
Deployment Results: ⚠ frontend: File already exists (use --overwrite to replace)Summary: Deployed: 0 Conflicts: 1Exit Codes:
- 0: All agents deployed successfully
- 1: One or more agents failed or conflicts
See Also:
cami list- See available agentscami scan- Check deployed versions
cami scan
Purpose: Scan a project to discover deployed agents and check for updates.
Usage:
cami scan --location <path>cami scan -l <path>Parameters:
-l, --location <path>- Project path to scan (required)
Example:
cami scan -l ~/projects/my-appOutput:
Scanning /Users/you/projects/my-appFound 3 deployed agents✓ frontend: up-to-date (deployed: v2.0.1, available: v2.0.1)⚠ backend: update-available (deployed: v1.5.0, available: v2.1.0)○ designer: not-deployedStatus Indicators:
- up-to-date: Deployed version matches source
- update-available: Newer version in sources
- not-deployed: Available but not deployed
Use Cases:
- Before updating agents
- Auditing unknown projects
- Checking project state
See Also:
cami deploy- Deploy updatescami source update- Pull latest source versions
cami update-docs
Purpose: Update project's CLAUDE.md with deployed agent documentation.
Usage:
cami update-docs --location <path>cami update-docs -l <path>Parameters:
-l, --location <path>- Project path (required)
Example:
cami update-docs -l ~/projects/my-appOutput:
Updated CLAUDE.md at /Users/you/projects/my-appDocumented 3 agents: • frontend (v2.0.1) • backend (v2.1.0) • designer (v1.1.0)What Gets Updated:
CAMI inserts or updates a managed section in CLAUDE.md:
<!-- CAMI-MANAGED: DEPLOYED-AGENTS | Last Updated: 2025-11-24T10:30:00Z -->## Deployed Agents### frontend (v2.0.1)Front-end specialist for React and modern web UIs.### backend (v2.1.0)Back-end specialist for Node.js API development.<!-- /CAMI-MANAGED: DEPLOYED-AGENTS -->Behavior:
- Creates CLAUDE.md if doesn't exist
- Preserves user content outside managed sections
- Safe to run multiple times (idempotent)
See Also:
cami deploy- Deploy before documentingcami scan- Verify deployed agents
Source Management
cami source add
Purpose: Clone a Git repository of agents and register it as a source.
Usage:
cami source add <git-url> [options]Parameters:
<git-url>- Git repository URL (required)-n, --name <name>- Source name (derived from URL if omitted)-p, --priority <number>- Priority (default: 50)
Examples:
Basic add:
cami source add git@github.com:company/agents.gitOutput:
Cloning agents to ~/cami-workspace/sources/agents...✓ Cloned agents to ~/cami-workspace/sources/agents✓ Added source with priority 50✓ Found 12 agentsWith custom name and priority:
cami source add git@github.com:company/agents.git --name company-agents --priority 10Clone Location:
- Default:
~/cami-workspace/sources/<name>/ - With CAMI_DIR:
$CAMI_DIR/sources/<name>/
Priority: Lower numbers = higher precedence. Personal agents typically use low numbers (10), official agents use higher numbers (100).
Config Update:
Adds entry to ~/cami-workspace/config.yaml:
agent_sources: - name: company-agents type: local path: /Users/you/cami-workspace/sources/company-agents priority: 10 git: enabled: true remote: git@github.com:company/agents.gitSee Also:
cami source list- View configured sourcescami source update- Pull latest changes
cami source list
Purpose: View all configured agent sources.
Usage:
cami source listOutput Example:
Agent Sources: official-agents (priority 50) Path: /Users/you/cami-workspace/sources/official-agents Agents: 15 Git: git@github.com:lando/official-agents.git team-agents (priority 30) Path: /Users/you/cami-workspace/sources/team-agents Agents: 8 Git: git@github.com:company/team-agents.git my-agents (priority 10) Path: /Users/you/cami-workspace/sources/my-agents Agents: 2Details:
- Shows all configured sources
- Displays priority (for deduplication)
- Counts agents in each source
- Shows Git remote if configured
Empty State:
No agent sources configured.Add a source with: cami source add <git-url>See Also:
cami source add- Add new sourcescami list- View all available agents (deduplicated)
cami source update
Purpose: Pull latest changes from Git for agent sources.
Usage:
cami source update [name]Parameters:
[name]- Optional: specific source name (updates all if omitted)
Examples:
Update all sources:
cami source updateOutput:
Updating official-agents... ✓ UpdatedUpdating team-agents... ✓ Up to dateUpdating my-agents...Updated: official-agentsSkipped (no git remote): my-agentsUpdate specific source:
cami source update team-agentsOutput:
Updating team-agents... ✓ UpdatedUpdated: team-agentsBehavior:
- Runs
git pullin each source directory - Skips sources without Git configuration
- Continues on error (updates what it can)
After Updating:
cami listshows new versionscami deployuses updated contentcami scandetects available updates
See Also:
cami source status- Check for uncommitted changes firstcami scan- Find projects needing updates
cami source status
Purpose: Show Git working tree status for agent sources.
Usage:
cami source statusOutput Example:
Agent Source Status: official-agents Git: ✓ clean team-agents Git: ⚠ 3 uncommitted changes M frontend.md M backend.md ?? new-agent.md my-agents Git: not enabledStatus Indicators:
- clean: No uncommitted changes
- N uncommitted changes: Modified/added files
- not enabled: No Git configuration
Use Case:
Before updating sources:
cami source status # Check for changes# Review uncommitted workcami source update # Pull latestSee Also:
cami source update- Pull latest changes
cami source remove
Purpose: Remove an agent source from configuration.
Usage:
cami source remove <name>Parameters:
<name>- Source name to remove (required)
Example:
cami source remove old-agentsOutput:
✓ Removed source "old-agents" from configurationNote: Directory ~/cami-workspace/sources/old-agents still exists.Remove it manually with: rm -rf ~/cami-workspace/sources/old-agentsImportant:
- Only removes from config (doesn't delete files)
- To delete files:
rm -rf ~/cami-workspace/sources/<name> - Reversible: just
cami source addagain
See Also:
cami source list- View configured sources
Location Management
cami locations
Purpose: List all configured deployment locations.
Usage:
cami locations [--output <format>]Parameters:
--output <format>- Output format: text or json (default: text)
Example:
cami locationsOutput:
Configured Deployment Locations (3):NAME PATH---- ----my-app /Users/you/projects/my-appapi-backend /Users/you/projects/api-backendlanding-page /Users/you/projects/landing-pageJSON Output:
cami locations --output json{ "locations": [ { "name": "my-app", "path": "/Users/you/projects/my-app" }, { "name": "api-backend", "path": "/Users/you/projects/api-backend" } ], "count": 2}Empty State:
No deployment locations configured.To add a location: cami location add --name <name> --path <path>See Also:
cami location add- Register locationscami location remove- Unregister locations
cami location add
Purpose: Register a project directory as a deployment location.
Usage:
cami location add --name <name> --path <path>cami location add -n <name> -p <path>Parameters:
-n, --name <name>- Friendly location name (required)-p, --path <path>- Absolute project path (required)
Examples:
Add location:
cami location add -n my-app -p ~/projects/my-appOutput:
Successfully added location 'my-app' -> /Users/you/projects/my-appWith absolute path:
cami location add -n api-backend -p /Users/you/projects/api-backendValidation:
- Name must be unique
- Path must exist
- Path must be a directory
- Path must be absolute (or ~ is expanded)
Error Conditions:
# Duplicate namecami location add -n my-app -p ~/projects/other# Error: location with name "my-app" already exists# Path doesn't existcami location add -n test -p ~/nonexistent# Error: path does not exist: /Users/you/nonexistentSee Also:
cami locations- View saved locationscami location remove- Unregister locations
cami location remove
Purpose: Unregister a deployment location.
Usage:
cami location remove --name <name>cami location remove -n <name>Parameters:
-n, --name <name>- Location name to remove (required)
Example:
cami location remove -n my-appOutput:
Successfully removed location 'my-app'Important:
- Only removes from config (doesn't delete project)
- No impact on deployed agents
- Reversible: just
cami location addagain
See Also:
cami locations- View locationscami location add- Re-register locations
Global Options
--help
Purpose: Show help information for CAMI or specific commands.
Usage:
cami --help # Global helpcami <command> --help # Command-specific helpExamples:
cami --help # Show all commandscami deploy --help # Deployment optionscami source --help # Source management commandscami source add --help # Specific subcommand help--version
Purpose: Display CAMI version information.
Usage:
cami --versioncami -vOutput:
CAMI v0.3.0Claude Agent Management InterfaceScripting and Automation
JSON Output Mode
Many commands support --output json for scripting:
# Get deployment results as JSONresult=$(cami deploy -a frontend -l ~/projects/my-app --output json)echo "$result" | jq '.deployed[]'# Get locations as JSONlocations=$(cami locations --output json)echo "$locations" | jq '.locations[].name'Exit Codes
CAMI uses standard exit codes for scripting:
# Successcami deploy -a frontend -l ~/projects/my-appecho $? # 0# Failure (agent not found)cami deploy -a nonexistent -l ~/projects/my-appecho $? # 1# Check exit codeif cami deploy -a frontend -l ~/projects/my-app; then echo "Deployment succeeded"else echo "Deployment failed"fiScripting Examples
Deploy agents to multiple projects:
#!/bin/bashprojects=( "~/projects/app-1" "~/projects/app-2" "~/projects/app-3")for project in "${projects[@]}"; do echo "Deploying to $project..." cami deploy -a frontend,backend -l "$project" --overwritedoneCheck for updates across projects:
#!/bin/bash# Get all configured locationslocations=$(cami locations --output json | jq -r '.locations[].path')for location in $locations; do echo "Checking $location..." cami scan -l "$location" echo ""doneUpdate sources and deploy to projects:
#!/bin/bashset -e # Exit on error# Update all sourcesecho "Updating agent sources..."cami source update# Deploy to configured projectsecho "Deploying to projects..."cami deploy -a frontend,backend -l ~/projects/app-1 --overwritecami deploy -a frontend,backend -l ~/projects/app-2 --overwrite# Update documentationecho "Updating documentation..."cami update-docs -l ~/projects/app-1cami update-docs -l ~/projects/app-2echo "Deployment complete!"CI/CD Integration
GitHub Actions Example
name: Deploy CAMI Agentson: push: branches: [main] paths: - '.claude/agents/**'jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install CAMI run: | curl -sSL https://install.cami.run | bash echo "$HOME/.cami/bin" >> $GITHUB_PATH - name: Deploy agents run: | cami deploy -a frontend,backend -l . --overwrite cami update-docs -l . - name: Commit changes run: | git config user.name "CAMI Bot" git config user.email "cami@example.com" git add CLAUDE.md git commit -m "Update agent documentation" || true git pushPre-commit Hook
#!/bin/bash# .git/hooks/pre-commit# Check if agent sources have uncommitted changesif ! cami source status | grep -q "✓ clean"; then echo "Error: Agent sources have uncommitted changes" echo "Commit or stash changes in ~/cami-workspace/sources/ first" exit 1fi# Ensure CLAUDE.md is up to dateif [[ -f CLAUDE.md ]]; then cami update-docs -l . git add CLAUDE.mdfiComparison: CLI vs MCP Tools
| Operation | CLI Command | MCP Tool (via Claude) | Best For |
|---|---|---|---|
| List agents | cami list | "What agents are available?" | CLI: Scripts / MCP: Interactive |
| Deploy agents | cami deploy -a X,Y -l PATH | "Deploy X and Y to my-app" | CLI: Automation / MCP: Ad-hoc |
| Add source | cami source add URL | "Add source from URL" | CLI: Setup scripts / MCP: First-time |
| Update sources | cami source update | "Update all sources" | CLI: Cron jobs / MCP: Manual |
| Scan project | cami scan -l PATH | "What agents are deployed here?" | CLI: Audits / MCP: Discovery |
When to Use CLI:
- Scripting and automation
- CI/CD pipelines
- Batch operations
- Cron jobs
- Non-interactive environments
When to Use MCP (Claude):
- Interactive agent management
- Natural language workflows
- Complex multi-step operations
- Learning and exploration
- Context-aware decisions
Environment Variables
CAMI_DIR
Purpose: Override default CAMI workspace location.
Default: ~/cami-workspace
Usage:
export CAMI_DIR=~/my-custom-cami-workspacecami source add git@github.com:company/agents.git# Clones to ~/my-custom-cami-workspace/sources/agentsAffects:
- Source clone location
- Config file location (
$CAMI_DIR/config.yaml) - Central manifest location
- Backup locations
Configuration Files
Config Location
Default: ~/cami-workspace/config.yaml
With CAMI_DIR: $CAMI_DIR/config.yaml
Manual Config Editing
While CLI commands update config automatically, you can edit manually:
# Open config in editor$EDITOR ~/cami-workspace/config.yaml# Validate config (implicit on next command)cami source listSee Also:
- Configuration Reference - Complete config.yaml spec
Troubleshooting
Command Not Found
$ cami --versionbash: cami: command not foundSolution:
# Check if CAMI is installedwhich cami# If not installed, install via:# - Binary release# - Build from source: cd ~/cami && make install# - Check PATH includes installation directoryPermission Denied
$ cami source add git@github.com:company/agents.gitError: failed to create config directory: permission deniedSolution:
# Ensure you have write access to home directorymkdir -p ~/cami-workspacechmod 755 ~/cami-workspace# Or use custom CAMI_DIRexport CAMI_DIR=/path/with/permissionsGit Authentication
$ cami source add git@github.com:company/agents.gitError: failed to clone repository: Permission denied (publickey)Solution:
# Ensure SSH key is configuredssh -T git@github.com# Or use HTTPS with credentialscami source add https://github.com/company/agents.gitNo Sources Configured
$ cami listError: no agent sources configuredSolution:
# Add an agent source firstcami source add git@github.com:lando/agents.git# Then list agentscami listRelated Documentation
- MCP Tools API Reference: Natural language interface
- Workspace Files Reference: config.yaml specification
- Getting Started - Installation: Install CAMI
- Getting Started - First-Time Setup: Configure Claude Code
Last Updated: 2025-11-24