OpenCode Plugin — Agentuity Documentation

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
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.6GPT 5.3 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.

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.

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-6",
      "temperature": 0.7
    },
    "Agentuity Coder Architect": {
      "model": "openai/gpt-5.3-codex",
      "reasoningEffort": "xhigh"
    }
  }
}
OptionDescription
modelModel identifier (e.g., anthropic/claude-opus-4-6)
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

Monitoring Sessions

View and inspect OpenCode coding sessions from the CLI.

Dashboard

Display an overview of recent sessions with status, message counts, active tools, costs, and todos:

agentuity ai opencode dashboard
OptionDescription
--watchContinuously refresh the dashboard (press q to quit, r to refresh)
--interval <seconds>Refresh interval in watch mode (default: 5)
--limit <n>Maximum sessions to show (default: 10)
--allShow all sessions (overrides default limit)
--since <duration>Filter by recent activity (30m, 1h, 6h, 24h, 7d)
--status <status>Filter by status: active, idle, error, archived, compacting
--search <query>Search sessions by title (case-insensitive)
--session <id>Focus on a specific session tree
--all-todosShow all todos including completed (default: pending only)
--jsonOutput as JSON
# Watch active sessions updated in the last hour
agentuity ai opencode dashboard --watch --since 1h
 
# Only active sessions
agentuity ai opencode dashboard --status active
 
# Search by title
agentuity ai opencode dashboard --search "auth"
 
# 5 most recent idle sessions
agentuity ai opencode dashboard --limit 5 --status idle
 
# JSON output for scripting
agentuity ai opencode dashboard --json

Inspect

View detailed information about a specific session, including messages, active tools, recent tool history, todos, cost breakdown, and child sessions:

agentuity ai opencode inspect <session-id>
agentuity ai opencode inspect ses_abc123
 
# JSON output
agentuity ai opencode inspect ses_abc123 --json

Database Location

Both commands read from the local OpenCode SQLite database. The CLI searches standard platform locations automatically:

  • macOS: ~/Library/Application Support/opencode/opencode.db
  • Linux: ~/.local/share/opencode/opencode.db
  • Windows: %APPDATA%\opencode\opencode.db (fallback: %LOCALAPPDATA%\opencode\opencode.db)

Override the path with the OPENCODE_DB_PATH environment variable:

OPENCODE_DB_PATH=/path/to/opencode.db agentuity ai opencode dashboard

Next Steps