CLI
The AgentPool CLI provides a comprehensive set of commands to manage and interact with AI agents. It's designed around the concept of an "active agent file" - a YAML configuration that defines your agents and their settings. This avoids the need to pass the config file path each time you want to run a command.
Active Agent File¶
The CLI maintains an "active agent file" setting which determines which agents are available for commands like run, task, or watch.
You can:
- Add agent files with
agentpool add <name> <path> - Set the active file with
agentpool set <name> - List agents from the active config with
agentpool list-agents
Most commands will use the currently active agent file by default, but can be overridden with the --config option.
Available Commands¶
| Command | Description |
|---|---|
add |
Add a new agent configuration file. |
run |
Single-shot run a node (agent/team) with prompts. |
list-agents |
List agents from the active (or specified) configuration. |
list-configs |
List stored agent configurations. |
set |
Set the active agent configuration file. |
watch |
Run agents in event-watching mode. |
serve-acp |
Run agents as an ACP (Agent Client Protocol) server. |
serve-agui |
Run agents as an AG-UI server. |
serve-mcp |
Run agents as an MCP server. |
serve-api |
Run an agent as an OpenAI-compatible completions API server. |
serve-opencode |
Serve the agent pool through the OpenCode V2 HTTP API. |
serve-vercel |
Serve agents via Vercel AI Data Stream Protocol. |
task |
Execute a task with the specified agent. |
config |
Configuration management commands |
config show |
Show configuration resolution status. |
config paths |
Show standard configuration paths. |
config init |
Initialize a new configuration file. |
history |
Conversation history management |
history show |
Show conversation history with filtering options. |
history stats |
Show usage statistics. |
history reset |
Reset (clear) conversation history. |
ui |
Launch interactive user interfaces |
ui opencode |
Launch OpenCode TUI with integrated server or attach to existing one. |
ui toad |
Launch Toad TUI for ACP agents. |
ui desktop |
Launch OpenCode desktop app with integrated server or attach to existing one. |
Global options (before the command): --log-level / -l (debug, info, warning,
error) and --version / -v.
Quick Start¶
Option 1: Automatic Config Discovery¶
AgentPool automatically discovers config files. Just create agentpool.yml in your project:
# Create a starter config
agentpool config init
# Edit the config, then run
agentpool run myagent "Hello"
Option 2: Named Configurations¶
For managing multiple config files:
- Add and activate an agent configuration:
- List available agents:
- Run a prompt with an agent:
Command Examples¶
Running Agents¶
# Run a single agent with a prompt
agentpool run myagent "Analyze this"
# Run a team
agentpool run myteam "Process this"
# Show detailed output with costs
agentpool run myagent "Hello" --detail detailed --costs
Executing Tasks¶
# Execute a defined task
agentpool task docs write_api_docs
# Execute with additional prompt
agentpool task docs write_api_docs --prompt "Include code examples"
Server Commands¶
# ACP server for IDE integration (Zed, Toad)
agentpool serve-acp config.yml
# OpenCode server for OpenCode TUI/Desktop
agentpool serve-opencode config.yml --port 4096
# MCP server (stdio transport)
agentpool serve-mcp config.yml
# MCP server over Streamable HTTP
agentpool serve-mcp config.yml --transport streamable-http --port 3001
# AG-UI server
agentpool serve-agui config.yml --port 8002
# OpenAI-compatible API server
agentpool serve-api config.yml --port 8000
# Vercel AI Data Stream Protocol
agentpool serve-vercel config.yml
# OpenCode TUI with an integrated server
agentpool ui opencode config.yml
History Commands¶
# Show last 5 conversations
agentpool history show -n 5
# Show conversations from last 24 hours
agentpool history show --period 24h
# Show stats grouped by model
agentpool history stats --period 1w --group-by model
# Clear history for specific agent
agentpool history reset --agent myagent
Configuration Files¶
Agent configurations are YAML files that define:
- Available agents and their capabilities
- System prompts and knowledge sources
- Tool configurations
- Response types
- And more
Example:
agents:
analyzer:
display_name: "Text Analyzer"
model: openai:gpt-5-mini
description: "Analyzes text and provides structured output"
tools:
- type: file_access
See the Configuration Guide for detailed information about agent configuration.