Skip to content

[FEATURE]: Support "extends" in opencode.json / opencode.jsonc for configuration inheritance #41565

Open

Description

@JoseGalRe

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

Currently, OpenCode supports merging settings cascadingly from global to project-level configurations (~/.config/opencode/opencode.json and <project>/opencode.json). However, there is no native way to explicitly inherit or share standard configurations across multiple unrelated repositories using an "extends" property, similar to how it works in TypeScript (tsconfig.json), ESLint, or native JSON Schema extensions.

Adding an "extends" keyword would allow teams and developers to maintain a single "base" configuration (or reference a shared company-wide config package/file) and only override specific keys on local projects.

Proposed Behavior

In any opencode.json or opencode.jsonc, a developer should be able to define a path (local relative path or potentially a remote URL/npm package) under an extends key:

// <project-root>/opencode.jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "extends": "../shared-configs/base-opencode.jsonc",
  "model": "anthropic/claude-sonnet-4-5", // Override base model
  "tools": {
    "bash": true // Enable specific tool for this repo
  }
}

Benefits

  • Dry Configuration: Avoid copy-pasting complex MCP server setups, custom agents, or permission blocks across dozens of microservices.
  • Team Standards: Organizations can distribute a single standard configuration file, and developers just extend it.
  • Familiar DX: Aligns perfectly with standard ecosystem tools that developers use daily.

Additional Context

  • It should support both .json and .jsonc targets during resolution.
  • Properties within the current file should deeply merge or overwrite properties coming from the extended file.

Activity

  1. kaddkaka commented on Oct 6, 2026

    @kaddkaka

    Would also really like this 👍

    What should happen if the shared config isn't available?

    • Stop and report it as an error
    • Warn but continue loading the local config without the shared base configuration
  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed request, @JoseGalRe!

    To restate it: you'd like opencode.json / opencode.jsonc to support an extends key that points to a base config (a relative path, and possibly a URL or npm package). The local file would deep-merge over the base, so a team can share MCP servers, agents and permissions across many repositories.

    OpenCode doesn't support this today. Configs merge from global to project level, and you can point to one extra config file with the OPENCODE_CONFIG environment variable. The {file:path} syntax only inserts a file's contents as a string value, so it can't pull in a whole config object. A plugin can't fill the gap either, because plugins are loaded from the config itself.

    I've marked this as a feature request for the maintainers to consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions