You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Support "extends" in opencode.json / opencode.jsonc for configuration inheritance #41565
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.
Reacted by Bryan Galdámez, Enrique Guerrero, David Moberg and Alex
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.
Activity
kaddkaka commentedon Oct 6, 2026
Would also really like this 👍
What should happen if the shared config isn't available?
opencodejr commentedon Oct 28, 2026
Thanks for the detailed request, @JoseGalRe!
To restate it: you'd like
opencode.json/opencode.jsoncto support anextendskey 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_CONFIGenvironment 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.