The OpenCode Autopilot CLI provides tools to install, configure, and verify the plugin. It runs using Bun and can be invoked directly via bunx or installed globally.
You can run the CLI without a local installation using bunx:
bunx @kodrunhq/opencode-autopilot [command]Alternatively, install it globally using npm:
npm install -g @kodrunhq/opencode-autopilotThe npm global path still requires Bun on PATH, because the published CLI entrypoints use a Bun shebang and the plugin uses Bun-specific APIs.
The install command sets up the plugin for use with OpenCode.
What it does:
- Checks if the OpenCode CLI is installed on your system.
- Resolves OpenCode configuration following OpenCode's rules: checks
OPENCODE_CONFIGenv var,OPENCODE_CONFIG_DIRenv var, project config (walking up from cwd to git root), then global config at~/.config/opencode/.opencode.json. - Creates a new
.opencode.jsonat the appropriate location if no config exists (at git root if in a repo, otherwise in global config). - Supports both JSON and JSONC (JSON with Comments) formats.
- Registers
@kodrunhq/opencode-autopilotin thepluginarray. - Creates a starter configuration file at
~/.config/opencode/opencode-autopilot.jsonif it does not exist.
Usage:
bunx @kodrunhq/opencode-autopilot installOptions:
--no-tui: Disables the text user interface during installation.
The configure command launches an interactive wizard to assign models to agent groups.
What it does:
- Walks through the 8 model groups: Architects, Challengers, Builders, Reviewers, Red Team, Researchers, Communicators, and Utilities.
- Allows you to select a primary model and multiple fallback models for each group.
- Validates adversarial diversity between groups, ensuring Builders and Reviewers use different model families.
- Saves the assignments to your global configuration file.
Usage:
bunx @kodrunhq/opencode-autopilot configureThe doctor command runs a suite of health diagnostics to ensure the plugin is correctly set up.
What it does:
- System Checks: Verifies OpenCode installation, plugin registration in OpenCode config (respecting
OPENCODE_CONFIG,OPENCODE_CONFIG_DIR, project config, and global config), and configuration file health. - Plugin Load Verification: Verifies OpenCode CLI accessibility (note: due to OpenCode architecture, actual plugin loading can only be verified by starting a TUI session).
- Model Assignments: Lists the primary and fallback models assigned to each agent group.
- Adversarial Diversity: Checks if adversarial pairs, like Architects and Challengers, use different model families to avoid confirmation bias.
- Suggestions: Provides actionable steps to fix any identified issues.
Usage:
bunx @kodrunhq/opencode-autopilot doctorThe inspect command queries the plugin kernel database for stored projects, pipeline runs, events, lessons, preferences, and memory data.
What it does:
- Reads from the SQLite kernel database that the plugin maintains across sessions.
- Supports 8 views that expose different aspects of the plugin's stored state.
- Can output as human-readable text (default) or structured JSON.
Usage:
bunx @kodrunhq/opencode-autopilot inspect <view> [options]Views:
| View | Description | Required Options |
|---|---|---|
projects |
List all known projects | None |
project |
Show details for one project | --project <ref> |
paths |
List a project's path history | --project <ref> |
runs |
List pipeline runs (default limit: 20) | None (optional --project) |
events |
List forensic events | None (optional --project, --run-id, --session-id, --type) |
lessons |
List stored lessons | None (optional --project) |
preferences |
List stored user preferences | None |
memory |
Show memory overview | None |
Options:
--project <ref>: Project id, path, or unique name. Required forprojectandpathsviews, optional filter forruns,events, andlessons.--run-id <id>: Filter events by pipeline run id.--session-id <id>: Filter events by session id.--type <type>: Filter events by event type.--limit <n>: Limit the number of rows returned (default: 20 forruns, 50 for other views).--json: Emit output as structured JSON instead of formatted text.--help,-h: Show the inspect help message.
Examples:
# List all known projects
bunx @kodrunhq/opencode-autopilot inspect projects
# Show details for a specific project
bunx @kodrunhq/opencode-autopilot inspect project --project /path/to/repo
# List recent pipeline runs as JSON
bunx @kodrunhq/opencode-autopilot inspect runs --json --limit 10
# View events for a specific run
bunx @kodrunhq/opencode-autopilot inspect events --run-id abc123
# Show memory overview
bunx @kodrunhq/opencode-autopilot inspect memoryRegister the plugin in a new project:
bunx @kodrunhq/opencode-autopilot installUpdate model assignments:
bunx @kodrunhq/opencode-autopilot configureVerify installation health:
bunx @kodrunhq/opencode-autopilot doctorInspect stored projects:
bunx @kodrunhq/opencode-autopilot inspect projectsThe CLI uses standard exit codes to indicate the result of an operation:
0: The command completed successfully.1: An error occurred. This could be due to invalid configuration, missing dependencies, or failed health checks in thedoctorcommand.