feat(opencode): add plugin management CLI commands #7611
+376
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add CLI commands for managing OpenCode plugins, addressing the need for easy plugin updates without manual config editing.
Fixes #6159
Changes
Add
opencode pluginsubcommand with:list- List installed plugins with current/latest version comparisonupdate [name]- Update all or specific plugin to latest versionadd <name>- Add a plugin to configremove <name>- Remove a plugin from configImplementation Details
Config.getPluginName()for consistent name extraction,BunProc.install()for package installation@scope/pkg→%40scope%2Fpkg)update [email protected]andremove [email protected]correctly matchfoopluginpluginfieldDemo Output
How to verify
Testing Done
plugin list- shows installed plugins with version infoplugin list- shows "latest unknown" when fetch failsplugin update- updates all plugins to latestplugin update <name>- updates specific pluginplugin update <name>@<version>- normalizes input correctlyplugin add <name>- installs and adds plugin to configplugin add <name>@<version>- installs specific versionplugin remove <name>- removes plugin from configplugin remove <name>@<version>- normalizes input correctly