ReferenceCLI

OpenCode Plugin

Install the Agentuity plugin for OpenCode to enable AI-assisted development with specialized agents

The OpenCode plugin adds Agentuity-aware AI agents and slash commands to OpenCode, providing intelligent assistance for building, deploying, and managing your agents.

Installation

Install the plugin using the CLI:

agentuity ai opencode install

This configures OpenCode with:

  • Specialized AI agents for different development tasks
  • Slash commands for common Agentuity operations
  • MCP servers for library documentation and code search

To remove the plugin:

agentuity ai opencode uninstall

Specialized Agents

The plugin provides various specialized agents, each focused on a specific aspect of development:

Primary Agents

AgentRoleWhen to Use
LeadOrchestratorAutomatically coordinates all work
ScoutExplorerFinding files, patterns, codebase analysis (read-only)
BuilderImplementerInteractive code changes, quick fixes, guided implementation
ArchitectAutonomous ImplementerCadence mode, complex multi-file features, long-running tasks
ReviewerCode ReviewerReviewing changes, catching issues, suggesting fixes
MemoryContext ManagerStoring/retrieving context, decisions, patterns across sessions
ExpertAgentuity SpecialistCLI commands, cloud services, SDK questions
PlannerStrategic AdvisorComplex architecture decisions, deep technical planning (read-only)
RunnerCommand ExecutorRun lint/build/test/typecheck/format, returns structured summaries

Sub-Agents

These agents work as sub-agents, called by other agents when needed:

AgentRoleCalled By
ReasonerConclusion ExtractorMemory: extracts structured conclusions from sessions
ProductProduct StrategyLead: defines requirements, validates features, generates PRDs

OpenCode automatically routes tasks to the appropriate agent based on context.

Builder vs Architect

AspectBuilderArchitect
ModeInteractiveAutonomous
Best forQuick fixes, guided workCadence mode, complex features
ModelClaude Opus 4.5GPT 5.2 Codex
ReasoningHighMaximum (xhigh)
ContextSession-basedCheckpoint-based

Use Builder when working interactively, making quick changes, or needing guidance. Use Architect when running Cadence mode, implementing complex multi-file features, or needing autonomous execution with deep reasoning.

Memory System

The Memory agent uses entity-centric storage to persist context across sessions. It stores:

Entity TypeScopeExamples
userCross-projectYour preferences, patterns, corrections
projectProject-specificArchitecture decisions, codebase patterns
repoCross-projectRepository conventions, commit styles
agentCross-projectAgent-specific behaviors, model preferences

Memory tracks conclusions (patterns learned from your work), corrections (mistakes to avoid), and relationships between entities. The Reasoner sub-agent periodically extracts new insights from sessions.

Use /agentuity-memory-save to explicitly save important context, or let Memory capture it automatically during Cadence sessions.

Model Configuration

Override any agent's model in opencode.json. See Agent Model Overrides for full configuration options.

Run opencode models to see all available models.

Security

Sensitive CLI commands are blocked by default: agentuity cloud secrets, agentuity cloud apikey, and agentuity auth token.

Slash Commands

The plugin adds slash commands for common Agentuity tasks:

CommandDescription
/agentuity-coderRun tasks with the full agent team (Lead orchestrates)
/agentuity-cadenceStart a long-running autonomous loop
/agentuity-cloudInteract with any Agentuity cloud service
/agentuity-sandboxRun code in isolated sandbox environments
/agentuity-memory-saveSave session context to memory

Use these commands by typing them directly in OpenCode:

/agentuity-coder Create a new agent that processes webhooks from Stripe

MCP Servers

The plugin configures two MCP servers that provide additional context to the AI agents:

context7: Provides access to library documentation for common dependencies (AI SDK, Zod, Hono, etc.). Agents can look up API references and examples without leaving your editor.

grep_app: Enables searching GitHub repositories for code examples and patterns. Useful when you need to see how others have implemented similar features.

Headless Mode

Run Agentuity tasks from the command line without opening OpenCode:

agentuity ai opencode run "Create an agent that validates email addresses"

This executes the task using the appropriate agents and outputs the result. Useful for:

  • CI/CD pipelines that need AI-assisted code generation
  • Scripting repetitive development tasks
  • Batch processing multiple requests

Cadence Mode

Cadence enables long-running autonomous work sessions. Start it with the /agentuity-cadence slash command:

/agentuity-cadence Build a complete auth system with tests

Control Cadence through natural language:

ActionHow
Start/agentuity-cadence <task description>
Status"what's the status?"
Pause"pause" or "hold on"
Resume"continue" or "resume"
Stop"stop" or Ctrl+C

For headless execution:

agentuity ai opencode run "/agentuity-cadence Build the feature"

Background Agents

Run agents in the background while continuing other work. Background agents execute asynchronously and notify you when complete.

The plugin provides three tools for background task management:

ToolDescription
background_taskLaunch an agent task in the background
background_outputRetrieve the result of a completed task
background_cancelCancel a running or pending background task

Concurrency Control

Background tasks are rate-limited to prevent overwhelming providers. Configure in your Agentuity CLI profile (~/.config/agentuity/production.yaml):

coder:
  background:
    enabled: true
    defaultConcurrency: 3  # Override the default of 1
OptionDefaultDescription
enabledtrueEnable/disable background tasks
defaultConcurrency1Default max concurrent tasks per model
staleTimeoutMs1800000Timeout for stale tasks (30 minutes)
providerConcurrency{}Per-provider concurrency limits
modelConcurrency{}Per-model concurrency limits

Tmux Integration

When running inside tmux, background agents can spawn in separate panes for visual multi-agent execution.

Server Mode Required

Tmux integration requires OpenCode to run with an HTTP server enabled. Start OpenCode with opencode --port 4096.

Configure in your Agentuity CLI profile:

coder:
  tmux:
    enabled: true
    maxPanes: 6
OptionDefaultDescription
enabledfalseEnable tmux pane spawning
maxPanes4Max agent panes before rotating oldest out
mainPaneMinWidth100Minimum width for main pane (columns)
agentPaneMinWidth40Minimum width for agent panes (columns)

When enabled, agents spawn in a dedicated "Agents" window with a tiled grid layout. Oldest panes close automatically when maxPanes is reached.

Configuration

Agent models are configured in ~/.config/opencode/opencode.json. Plugin behavior settings go in your Agentuity CLI profile (~/.config/agentuity/production.yaml).

Agent Model Overrides

Override any agent's default model in opencode.json:

{
  "agent": {
    "Agentuity Coder Builder": {
      "model": "anthropic/claude-opus-4-5-20251101",
      "temperature": 0.7
    },
    "Agentuity Coder Architect": {
      "model": "openai/gpt-5.2-codex",
      "reasoningEffort": "xhigh"
    }
  }
}
OptionDescription
modelModel identifier (e.g., anthropic/claude-opus-4-5-20251101)
temperatureNumber between 0-1 (lower = more deterministic)
reasoningEffortFor OpenAI: low, medium, high, xhigh
variantFor Anthropic: low, medium, high, max (extended thinking)
thinkingFor Anthropic: { "type": "enabled", "budgetTokens": 10000 }
maxStepsMaximum tool use steps per turn

MCP Server Configuration

Add MCP servers for enhanced agent capabilities in opencode.json:

{
  "mcp": {
    "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp" },
    "grep_app": { "type": "remote", "url": "https://mcp.grep.app" }
  }
}
MCPPurposeFree Tier
context7Library docs lookup500 req/month
grep_appGitHub code searchUnlimited

Plugin Behavior Settings

Configure plugin behavior in your Agentuity CLI profile (~/.config/agentuity/production.yaml):

coder:
  tmux:
    enabled: true
  background:
    defaultConcurrency: 3

Next Steps

Need Help?

Join our DiscordCommunity for assistance or just to hang with other humans building agents.

Send us an email at hi@agentuity.com if you'd like to get in touch.

Please Follow us on

If you haven't already, please Signup for your free account now and start building your first agent!