Skip to content

[FEATURE]: for splitting config across multiple files #19353

@mynameistito

Description

@mynameistito

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I want to split my opencode.jsonc into separate files. Right now if you have a lot of MCP servers, agent configs, or provider settings, the single config file gets long and messy. You can work around it with .opencode/ directory configs and OPENCODE_CONFIG env vars, but those are workarounds, not a proper composition mechanism.

I'd like a field that lets you reference other JSON/JSONC files and have them merged in

Examples:

// opencode.jsonc
{
  "": ["./mcp.jsonc", "./agents.jsonc"],
  "model": "anthropic/claude-sonnet-4-20250514",
  "share": "auto"
}
// mcp.jsonc
{
  "mcp": {
    "github": {
      "type": "remote",
      "url": "https://mcp.github.com/...",
      "enabled": true
    },
    "filesystem": {
      "type": "local",
      "command": ["npx", "@anthropic/fs-mcp", "/tmp/projects"],
      "timeout": 10000
    }
  }
}
// agents.jsonc
{
  "agent": {
    "reviewer": {
      "model": "anthropic/claude-haiku-4-20250414",
      "description": "Code review agent"
    }
  }
}

Extended files would merge in array order, with the main config taking precedence on conflicts. Extended files should be able to their own files too, with circular reference detection so it doesn't loop forever.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions