serve-opencode

serve-opencode

Run agents as an OpenCode-compatible HTTP server.

This creates an HTTP server implementing the OpenCode API protocol, enabling your AgentPool agents to work with OpenCode TUI and SDK clients.

Configuration Layers (merged in order, later overrides earlier):

  1. Global config - ~/.config/agentpool/agentpool.yml for user preferences
  2. Custom config - AGENTPOOL_CONFIG env var for CI/deployment overrides
  3. Project config - agentpool.yml in project/git root for project-specific settings
  4. Explicit config - CLI argument (highest precedence)
  5. Built-in fallback - Only used if no agents defined in any layer

Agent Selection: Use --agent to specify which agent to use by name. Without this option, the pool's default agent is used (set via 'default_agent' in config, or falls back to the first agent).

agentpool serve-opencode [OPTIONS] [CONFIG]

config

-h, --host

Default: 127.0.0.1 Host to bind to

-p, --port

Default: 4096 Port to listen on

--agent

Name of specific agent to use (defaults to pool's default agent)

-w, --working-dir

Working directory for file operations (defaults to current directory)

--help

Flag Show this message and exit.