cli: plugin list shows - for ID of TUI-only plugins configured in cli.json

未关闭 适合新手
#64,175 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@yash-alla 已经在做这个了。

开始于 2026年11月16日。

  • #64287 来自 @yash-alla —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
cli

调研方向

追踪 opencode plugin list 如何构建 ID 列并读取插件数据,从 CLI 命令及其测试开始。将服务器端注册表数据与 SOURCE 中已显示的包名进行比较,然后为仅在 TUI 中配置的插件添加有用的回退方案。当 ID 列能为仅在 cli.json 中配置的插件显示有意义的值,且相关测试通过时,任务即完成。

由索引模型根据 Issue 内容生成。

描述

area/cli platform/windows type/feature version/v2

Summary

opencode plugin list shows - in the ID column for TUI-only plugins (packages exporting only ./tui, configured in cli.json), even though the plugin loads and works correctly. The ID column should fall back to something useful — ideally the package name — when the plugin has no server-side registry entry.

Environment

  • opencode version: 2.3.0
  • OS: reproduced on Windows 11, but this is platform-independent CLI output
  • Active plugins: a TUI-only package (exports only ./tui) configured in cli.json, alongside server+TUI packages configured in opencode.json

Reproduction

  1. Publish (or link) a plugin package that exports only a TUI part and declares a TUI id:

    "exports": { "./tui": "./dist/tui.js" }
    
    export default Plugin.define({ id: "usage.quota", setup(ctx) { /* ... */ } })
    
  2. Configure it in ~/.config/opencode/cli.json (the documented location for TUI-only packages):

    { "plugins": ["your-tui-only-plugin"] }
    
  3. Run opencode plugin list, with at least one server+TUI plugin configured in opencode.json for comparison.

Expected Behavior

The ID column should display something useful for TUI-only plugins. Two reasonable fallbacks, in order of preference:

  1. The package name — it is already available and displayed in the SOURCE column, so the data needs no new plumbing.
  2. The TUI part's declared id (e.g. usage.quota) when there is no server-side entry.

Actual Behavior

The ID column shows - for the TUI-only plugin, while server+TUI plugins configured in opencode.json show their IDs:

ID                       VERSION  SOURCE
-                        0.2.2    opencode-coding-quota
<server-plugin-a>        1.0.0    <server-plugin-a>
<server-plugin-b>        1.0.0    <server-plugin-b>

Additional Context

  • The plugin itself works fine (loads in the TUI, renders its UI). This is purely a display issue in plugin list, but it is confusing for plugin authors: it looks like the package is broken or not detected.
  • Verified against the running service via GET /api/plugin: the TUI-only plugin is absent from the server-side registry because it is loaded directly by the TUI from cli.json — by design, per the docs, so it remains active against remote servers. The plugin list ID column appears to read only that server-side registry, hence the -.
  • Reproduced consistently on every invocation.
  • Real-world npm package that triggers this: opencode-coding-quota.
  • No workaround short of adding an empty server part to the package and moving it to opencode.json — which sacrifices the documented remote-server benefit of cli.json for TUI-only packages.
主要语言
TypeScript
星标
227k
派生
30.7k
平均合并
4 小时 35 分钟
30 天内合并 PR
498

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。