Skip to content

[FEATURE]: Provide CLI command to modify the config file #14008

@JonasDoe

Description

@JonasDoe

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

Some plugins won't work by just adding them to the config file. As a famous example, oh-my-opencode comes with a more complex install routine (to be run by an AI agent). I noticed that it's rather hard to adjust the config file via such a routine (e.g. adding entries to plugin, instructions or mcp):
It's just a bit tedious as long as we're only talking about a json file (check whether opencode.jsonc or opencode.json esist, check whether the plugin entry exists, if not, create it, otherwise check whether the value to add is already in there, and if not, add it). But it becomes quite a challenge in case we're facing a jsonc file - especially since the install routine shouldn't have to install more dependencies just to handle that.

In my opinion, it's unnecessary that every new tool needs to reinvent (or duplicate) the wheel here - opencode already has all the libraries and logic which are required to work with json and jsonc files. So ideally, there would be cli commands like opencode config add-plugin myPluginPath which could just get invoked, and so help the ecosystem to grow.

I'm not used to OpenCode's source code, but I figure I could create a PR for that, given there are no objections. Also, given this feature makes sense, it would be interesting to know: What add commands should be supported? Should there also be a remove? Is there a better command schema than what I've suggested? (I'm a bit inspired by the go mod subcommand syntax here.)

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

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