kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

feat(desktop): 斜杠命令面板未枚举插件贡献的 commands(仅内置命令 + skills)

Open ilovintit opened this issue 2 months ago • 1 comments

概述

桌面版的斜杠命令面板不枚举插件通过 commands 字段贡献的命令。同一台机器上,同一个插件的命令在 CLI 中可以正常检索和调用,在桌面版中完全不出现。

希望桌面版的命令面板把插件命令也纳入枚举,与 CLI 的注册表保持一致。

环境

  • Kimi Code Desktop 1.0.2 (macOS, arm64)
  • Kimi Code CLI 2.0.2(桌面版通过 node-pty 拉起本机 CLI,两者共用同一内核)

现象

插件清单声明了 commands:

{
  "name": "shw-plugins",
  "skills": "./kimi-code/skills/",
  "commands": "./kimi-code/commands/"
}

commands/ 下是 17 个 .md 文件(如 shw-work.md,frontmatter 含 description / argument-hint)。

  • CLI:命令可检索到,按文档以 <plugin>:<command> 形态注册,工作正常。
  • 桌面版:输入 / 后菜单里只有内置命令和 /skill:* 条目;输入 /shw-work 或 /shw-plugins 都匹配不到任何命令条目(匹配出来的是描述中含该字符串的 skill)。

同一插件的 skills(同样是 ./kimi-code/skills/ 形态、同样带尾斜杠)在桌面版加载正常并显示为 /skill:*,所以不是清单路径或安装的问题。

复现步骤

  1. 安装任意一个在 kimi.plugin.json 中声明了 commands 的插件,例如: /plugins install https://github.com/ilovintit/shw-plugins
  2. 在 CLI 中输入 /,可以检索到该插件贡献的命令。
  3. 在 桌面版 中输入 /,菜单中只有内置命令与 /skill:*,插件命令不存在。

定位

桌面端未开源,以下片段来自已发布产物的渲染包 /Applications/Kimi Code.app/Contents/Resources/desktop-dist/assets/main-*.js,已还原压缩后的变量名:

const SKILL_PREFIX = "skill:";

function buildMenu(skills = [], opts) {
  const builtins = opts?.towerEnabled === true
    ? BUILTINS
    : BUILTINS.filter(o => o.name !== "/tower");

  const items = skills.map(o => ({
    name: o.source === "builtin" ? `/${o.name}` : `/${SKILL_PREFIX}${o.name}`,
    desc: o.description,
    isSkill: true,          // 每一项都被硬编码为 skill
    acceptsInput: true
  }));

  return [...builtins, ...items];
}

调用点为 buildMenu(skills(), …)(该参数在解构时的名称即为 skills)。

BUILTINS 是一张静态表:

/new /clear /login /plan /swarm /tower /goal /btw /compact /undo /fork /export /status

因此桌面版命令面板 = 静态内置命令表 + skills 列表,没有第三条数据来源;插件贡献的 commands 从未进入枚举。这看起来不是加载失败,而是该面板尚未实现「插件命令」这一类目。

期望行为

桌面版命令面板枚举插件贡献的命令,并以文档所述的 <plugin>:<command> 形态展示与调用(与 CLI 一致)。理想情况下与 skills 区分显示,便于用户区分二者。

补充

从提交路径看,未匹配到菜单项的斜杠文本会走兜底分支原样提交给 CLI,因此手动输入完整命令名可能仍可执行——但没有补全与提示,发现成本很高。此项未实测。

相关文档:插件命令「registered as <plugin>:<command>」并支持 $ARGUMENTS 展开。

ilovintit avatar Sep 21 '26 08:09 ilovintit

Still reproducible on macOS 26.5.2 (arm64) with Kimi Code Desktop 1.2.0 and Kimi Code CLI 2.4.1.

The enabled bgv-ai-agent-framework plugin declares 55 Markdown commands and 114 skills. The same installation exposes the commands in the CLI, while the Desktop slash panel shows only skills. Entering the fully qualified /bgv-ai-agent-framework:bgv-autopilot does not surface a matching entry. Plugin hooks execute normally, and the plugin validation suite passes.

This also affects plugin management in Desktop: /plugins and /plugins info bgv-ai-agent-framework were submitted as ordinary chat text instead of opening the plugin UI.

The issue therefore persists in Desktop 1.2.0. CLI 2.4.1 is a working workaround.

BoogVAr avatar Oct 30 '26 16:10 BoogVAr