Feature 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.)
Feature 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-opencodecomes 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 toplugin,instructionsormcp):It's just a bit tedious as long as we're only talking about a
jsonfile (check whetheropencode.jsoncoropencode.jsonesist, check whether thepluginentry 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 ajsoncfile - 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 -
opencodealready has all the libraries and logic which are required to work withjsonandjsoncfiles. So ideally, there would be cli commands likeopencode config add-plugin myPluginPathwhich 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
addcommands should be supported? Should there also be aremove? Is there a better command schema than what I've suggested? (I'm a bit inspired by thego mod subcommandsyntax here.)