V1 to V2 Migration Reference

Breaking Changes

V2 has three intentional breaking changes:

  1. Plugins use a new API (V1 plugins will not work)
  2. Server API and clients have new contracts
  3. TUI configuration moves from tui.json(c) to one global cli.json

Side-by-Side Installation

V1 runs as opencode, V2 runs as opencode2. Both can coexist:

# V1 (existing)
npm install -g opencode-ai

# V2 (beta)
npm install -g @opencode-ai/cli@next

Config Migration Quick Reference

AreaV1V2
Permissionspermission map by toolpermissions ordered array
Agentsagent mapagents map (renamed fields)
Providerprovider map, npm fieldproviders map, package field
MCPmcp flat map, enabledmcp.servers map, disabled
Pluginsplugin arrayplugins array (object form)
Commandscommand mapcommands map
Referencesreference mapreferences map
Snapshotssnapshot booleansnapshots boolean
Mediaattachment objectmedia object
Skillsskills.paths + skills.urlsskills single array
Compactionpreserve_recent_tokenskeep.tokens
Compaction reservereservedbuffer

Agent Field Renames

V1V2
promptsystem
disabledisabled
permissionpermissions
maxStepssteps
model + variantmodel with #variant suffix

Permission Action Renames

V1V2
bashshell
tasksubagent
write / patchedit

Provider Migration

V1V2
npm: "@ai-sdk/..."package: "aisdk:@ai-sdk/..."
api: "https://..."settings.baseURL: "https://..."
options: { apiKey }settings: { apiKey }

Consolidated provider IDs:

V1 provider IDV2 provider ID
azure-cognitive-servicesazure
google-vertex-anthropicgoogle-vertex

TUI Config Migration

V1 loaded tui.json(c) from global and project directories. V2 uses one global file:

~/.config/opencode/cli.json

V2 migrates automatically on first startup when cli.json doesn’t exist. It reads tui.json and legacy kv.json state, converts settings, and writes cli.json. The V1 files are left unchanged.

Gotcha: Migration runs only while cli.json is absent. Once it exists, V2 treats it as the source of truth. If you created cli.json before starting V2, merge V1 settings manually.

Accepted but Unsupported Fields

V2 ignores these V1 fields with a warning (not compatibility bugs):

  • logLevel (use OPENCODE_LOG_LEVEL env var)
  • server (use V2 service options)
  • layout (already deprecated in V1)
  • compaction.tail_turns and compaction.prune
  • Agent name inside JSON config
  • V1 experimental fields: disable_paste_summary, batch_tool, openTelemetry, primary_tools, continue_loop_on_deny

Ask OpenCode to migrate for you:

Migrate my OpenCode configuration, including file-based definitions, from the V1 format to the native V2 format.
Preserve its behavior and all unrelated settings.

V1 and V2 fields can coexist at the top level. You don’t need to convert everything at once.