CLI Reference
Use Fleet from the command line with the fleet CLI.
Overview
The fleet CLI allows you to run agents, start MCP servers, and manage Fleet from the terminal.
Installation
The CLI is bundled with Fleet. Add it to your PATH:
# Add to ~/.zshrc or ~/.bashrc
export PATH="$PATH:/Applications/Fleet.app/Contents/MacOS"
Or create an alias:
alias fleet="/Applications/Fleet.app/Contents/MacOS/fleet-cli"
Commands
fleet run
Run an agent with optional parameters.
fleet run <agent-name> [options]
Options:
| Option | Description |
|---|---|
--param key=value |
Pass a parameter to the agent |
--workspace <path> |
Override workspace directory |
--non-interactive |
Disable approval prompts (use pre-approved permissions) |
--timeout <duration> |
Maximum execution time (e.g., "5m", "1h") |
--output <format> |
Output format: text, json, quiet |
Examples:
# Run code reviewer on a directory
fleet run code-reviewer --param path=./src --param focus=security
# Run with JSON output
fleet run analyzer --output json
# Run non-interactively (for automation)
fleet run daily-report --non-interactive --timeout 10m
Exit Codes:
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Agent error |
| 2 | Parameter validation failed |
| 3 | Permission denied |
| 124 | Timeout |
fleet mcp
Start Fleet as an MCP server, exposing agents as tools.
fleet mcp [options]
Options:
| Option | Description |
|---|---|
--transport <type> |
Transport: stdio (default), sse, websocket |
--port <number> |
Port for SSE/WebSocket transport |
--agents <names> |
Comma-separated list of agents to expose |
Examples:
# Start as stdio MCP server (for Claude Desktop, etc.)
fleet mcp
# Start as SSE server on port 8080
fleet mcp --transport sse --port 8080
# Expose only specific agents
fleet mcp --agents code-reviewer,doc-writer
MCP Tools Exposed:
Each agent becomes an MCP tool:
- Name: Agent name (e.g.,
code-reviewer) - Description: Agent description
- Parameters: Agent's parameter definitions
fleet agents
List and manage agents.
fleet agents [subcommand]
Subcommands:
# List all agents
fleet agents list
# Show agent details
fleet agents show <name>
# Create agent from AGENT.md
fleet agents create <path-to-agent.md>
# Delete an agent
fleet agents delete <name>
fleet triggers
Manage triggers from the command line.
fleet triggers [subcommand]
Subcommands:
# List all triggers
fleet triggers list
# Show trigger details
fleet triggers show <name>
# Run a trigger manually
fleet triggers run <name>
# Enable/disable a trigger
fleet triggers enable <name>
fleet triggers disable <name>
fleet skills
Manage skills from the command line.
fleet skills [subcommand]
Subcommands:
# List all skills
fleet skills list
# Show skill details
fleet skills show <name>
# Install a skill from a URL/path
fleet skills install <source>
fleet status
Show Fleet status and running agents.
fleet status
Output:
Fleet Desktop: Running
Gateway: Connected
Agents: 3 active, 2 idle
Active Agents:
code-reviewer Running 2m 34s
daily-report Waiting 45s
pr-reviewer Paused 12m 8s
fleet config
View and modify configuration.
fleet config [subcommand]
Subcommands:
# Show current config
fleet config show
# Get a specific value
fleet config get mcp.default_timeout
# Set a value
fleet config set mcp.default_timeout 60s
Environment Variables
| Variable | Description |
|---|---|
FLEET_CONFIG_DIR |
Override config directory |
FLEET_LOG_LEVEL |
Log level: debug, info, warn, error |
FLEET_NO_COLOR |
Disable colored output |
Scripting Examples
Run Agent and Capture Output
#!/bin/bash
result=$(fleet run code-reviewer --param path=./src --output json)
issues=$(echo "$result" | jq '.issues | length')
echo "Found $issues issues"
Automated Daily Report
#!/bin/bash
# Run as cron job: 0 9 * * * /path/to/daily-report.sh
fleet run daily-report \
--non-interactive \
--timeout 10m \
--output quiet
if [ $? -eq 0 ]; then
echo "Daily report completed successfully"
else
echo "Daily report failed"
exit 1
fi
Batch Process Files
#!/bin/bash
for file in ./src/*.ts; do
fleet run code-reviewer \
--param path="$file" \
--param focus=security \
--output quiet
done
Git Pre-Commit Hook
#!/bin/bash
# .git/hooks/pre-commit
fleet run commit-checker --non-interactive --timeout 30s
exit $?
MCP Integration
With Claude Desktop
Add to Claude Desktop's config:
{
"mcpServers": {
"fleet": {
"command": "/Applications/Fleet.app/Contents/MacOS/fleet-cli",
"args": ["mcp"]
}
}
}
With Other MCP Clients
Start Fleet as an SSE server:
fleet mcp --transport sse --port 8080
Connect your MCP client to http://localhost:8080/sse.
Troubleshooting
Command Not Found
# Check if CLI is accessible
which fleet
# If not found, add to PATH
export PATH="$PATH:/Applications/Fleet.app/Contents/MacOS"
Permission Denied
# Make CLI executable
chmod +x /Applications/Fleet.app/Contents/MacOS/fleet-cli
Connection Issues
# Check if Fleet Desktop is running
fleet status
# View logs
fleet logs --tail 50