OpenCode v2
OpenCode v2 is the beta version of the open source AI coding agent. It runs as opencode2 alongside V1’s opencode binary. V2 reworks the server API, plugin system, permission model, and internal architecture around an Effect-TS service core with a managed background service.
Overview
- Repo: github.com/anomalyco/opencode (default branch:
v2) - Install:
npm install -g @opencode-ai/cli@next - Run:
opencode2in your project - Runtime: Bun
- Language: TypeScript with Effect-TS
- Status: Beta - APIs, config, and plugin contracts may change
Contents
- Architecture - Client-server topology, package structure, service lifecycle
- Concepts - Core mental models: sessions, agents, permissions, plugins
- Quickstart - Install, connect a provider, start coding
- How-To - Configure agents, permissions, MCP servers, plugins
- Deep Dives - Effect service architecture, AI SDK abstraction, service lifecycle
- Walkthroughs - Request lifecycle, plugin hook chain
- Troubleshooting - Background service issues, common errors
- Notes - V1 to V2 migration reference, ecosystem
Resources
- V2 Docs - Official beta documentation
- Config Schema - JSON Schema for config validation
- Migration Guide - V1 to V2 migration
- Discord - Community