* feat(tui): redesign /plugins as a tabbed panel
Split the /plugins manager into Installed / Official / Third-party /
Custom tabs. The Official and Third-party marketplace catalogs load
lazily, so /plugins opens instantly and keeps working offline, with
fetch failures shown inline instead of closing the panel. The tab strip
is shared with the /model provider tabs via the new renderTabStrip
helper.
* fix(tui): show untiered marketplace entries and update badges
Address Codex review feedback on the /plugins tab redesign:
- Untiered marketplace entries (no `tier` field) now appear on the
Third-party tab instead of being invisible in both marketplace tabs.
- Installed plugins whose marketplace version is newer than the local
version render an `update <local> → <latest>` badge again, and
up-to-date plugins show `installed · v<version>` — restoring the
update visibility the pre-redesign marketplace UI had.
* fix(tui): decode Space for installed-plugin toggle
In terminals that send printable keys via Kitty/CSI-u sequences (e.g. VS
Code's integrated terminal), the Space key arrives as a printable char
rather than a Key.space match, so the Installed-tab Space toggle silently
stopped working. Check both matchesKey(Key.space) and the decoded
printable char to match the MCP selector and other dialogs.
* fix(tui): open custom marketplaces on the Third-party tab
When `/plugins marketplace <source>` points at a custom catalog whose
entries omit `tier`, those entries are classified into the Third-party
tab. Opening on Official left the visible tab empty and Enter could not
install anything, unlike the old marketplace picker which showed all
entries from the supplied source. Open on Third-party when a custom
source is supplied; the default catalog still lands on Official.
* docs(plugins): drop open-url wording and hyphenate Shift-Tab
Address Codex review feedback:
- The marketplace Enter action is install/update only (open-url rows were
removed), so say "install or update" instead of "open or install" and
drop the leftover changeset sentence about setup URLs.
- Use `Shift-Tab` (hyphen) instead of `Shift+Tab` to match the docs
typography convention.
* fix(tui): keep marketplace selection valid while loading
When the Official/Third-party catalog is still loading, `entries` is empty
and pressing ↓ computed `Math.min(-1, selectedIndex + 1)` = -1. The later
Enter then read `entries[-1]` and the first install silently did nothing.
Clamp the index to 0 while there are no entries.
* fix(tui): count tab separators in tab-strip fit check
renderTabStrip declared a strip to fit whenever the sum of tab cell widths
fit, but the returned string also inserts single spaces between tabs via
`segments.join(' ')`. At widths around 43-45 columns for a four-tab strip
this declared a fit while the joined line was wider, so the trailing tab
got truncated instead of showing the `<`/`>` scroll markers. Count the
inter-tab separators in both the full-fit check and the scrolling window
fit check.
* docs(plugins): fix Kimi Datasource redirect anchor
The datasource.md redirect pointed at ./plugins.html#kimi-datasource, but
plugins.md no longer has a `## Kimi Datasource` heading — it is now
`## Official Plugins`. Update the en/zh redirect targets and fallback
links to #official-plugins / #官方插件 so the link lands on an existing
anchor.
* docs(plugins): restore concise Kimi Datasource section
The `## Official Plugins` section had replaced the original
`## Kimi Datasource` section, leaving the datasource.md redirect pointing
at a missing anchor and the Datasource capabilities/usage unreachable.
Restore a concise `## Kimi Datasource` section (intro + OAuth login +
install steps + usage) in both en and zh so the #kimi-datasource anchor
is valid again and the content is reachable.
* docs(plugins): restore Installing-from-GitHub subheading
The tab-redesign rewrite had dropped the `### Installing from GitHub` /
`### 从 GitHub 安装` subheading and its lead sentence, leaving only the
four URL forms. Restore the heading and lead sentence in both en and zh.
* docs(plugins): expand Kimi Datasource and tidy marketplace docs
- Condense the Official / Third-party / Custom tab overview and trust-badge note
- Trim the custom marketplace JSON section to the minimal id + source shape
- Move and expand the Kimi Datasource section with install, usage, and coverage
* docs(plugins): fix heading style and drop Next steps section
- Use sentence case for the Datasource headings (How to use, What you can do)
- Rename the Datasource caveat heading to Billing and limitations / 计费与限制 to avoid a duplicate Notes / 注意事项 anchor
- Remove the Next steps section, which linked back to the on-page Datasource anchor
* fix(tui): repaint plugins panel from current theme palette
The /plugins panel and MCP selector captured a palette snapshot at construction. In auto theme mode, applyResolvedAutoTheme swaps currentTheme.palette and re-renders without remounting the open panel, so it kept stale colors until closed.
Read currentTheme.palette during render instead, drop the colors opt from both components and their call sites, and add a regression test that switches palettes on a mounted panel.
* fix(tui): repaint model tab strip from current theme palette
TabbedModelSelectorComponent cached a palette snapshot in opts and used it only for the tab strip. In auto theme mode the inner model list repaints from currentTheme but the strip kept the old colors until the dialog was closed.
Read currentTheme.palette on the render path instead, drop the colors opt and its three call sites, and add a regression test that switches palettes on a mounted selector and asserts the strip repaints. This removes the last palette snapshot among editor-replacement dialogs.
10 KiB
Plugins
Plugins 把可复用的 Kimi Code CLI 能力打包成可安装单元——可以添加 Agent Skills、在会话启动时自动加载指定 Skill,也可以声明 MCP servers 来提供真实工具能力。适合把工作流共享给团队、连接外部服务,或从官方 marketplace 安装扩展。
Kimi Code CLI 对 plugin 采用保守的加载策略:安装 plugin 时不会执行其中的 Python、Node.js、Shell、hook 或命令脚本。
安装与管理
在 TUI 中运行 /plugins 打开 plugin 管理器。它是一个面板,有四个 tab:Installed(管理已装的)、Official(Kimi 官方 marketplace plugin)、Third-party(第三方 marketplace plugin)、Custom(从 URL 安装),用 Tab / Shift-Tab 切换。常用按键:
| 按键 | 操作 |
|---|---|
Tab / Shift-Tab |
在 Installed / Official / Third-party / Custom 四个 tab 间切换 |
Space |
启用或禁用选中的已安装 plugin(Installed tab) |
D |
移除选中的已安装 plugin(Installed tab) |
M |
管理选中 plugin 的 MCP servers(Installed tab) |
R |
重新加载 installed.json 和所有 manifest(Installed tab) |
Enter |
Installed tab:查看 plugin 详情 · Official/Third-party tab:安装或更新 · Custom tab:安装 |
Esc |
返回或取消 |
也可以直接使用斜杠命令:
| 命令 | 说明 |
|---|---|
/plugins |
打开交互式 plugin 管理器 |
/plugins list |
列出已安装 plugins |
/plugins install <path-or-url> |
从本地目录、zip URL 或 GitHub 仓库 URL 安装 |
/plugins marketplace [source] |
浏览官方 marketplace,或传入自定义 marketplace JSON 的路径或 URL |
/plugins info <id> |
查看 plugin 详情和 diagnostics |
/plugins enable <id> |
启用 plugin |
/plugins disable <id> |
禁用 plugin |
/plugins remove <id> |
移除 plugin(需二次确认) |
/plugins reload |
重载 installed.json 和各 plugin manifest |
/plugins mcp enable <id> <server> |
启用 plugin 声明的 MCP server |
/plugins mcp disable <id> <server> |
禁用 plugin 声明的 MCP server |
Official 和 Third-party tab 按 tier 列出 marketplace plugin;Custom tab 从 URL 安装。切到对应 tab 时才会加载 marketplace 目录。每个安装会显示信任徽章:kimi-official(来自官方地址)、curated(来自精选地址)、third-party(其他所有情况)。
从 GitHub 安装
通过 /plugins install <url> 可以直接从 GitHub 仓库安装,支持四种 URL 形式:
https://github.com/<owner>/<repo>:安装最新 release;无 release 时回落到默认分支https://github.com/<owner>/<repo>/tree/<ref>:安装指定分支、tag 或短 commit SHAhttps://github.com/<owner>/<repo>/releases/tag/<tag>:钉死具体 taghttps://github.com/<owner>/<repo>/commit/<sha>:钉死具体 commit
网络请求只走 github.com 重定向和 codeload.github.com 下载,不调用 api.github.com。
注意事项
- Plugin 变更需要通过
/reload或新会话生效。安装、启用/禁用、移除后,运行/reload或/new;当前会话不会更新。 - 本地安装会被拷贝到
$KIMI_CODE_HOME/plugins/managed/<id>/,CLI 始终从这份托管副本运行。安装后编辑原始源目录不会生效,需重新安装。 - 移除 plugin 只会删除安装记录,托管副本和原始源文件仍保留在磁盘上。
- Plugin 目前按用户安装,对所有项目生效,暂不支持项目级安装范围。
自定义 marketplace JSON
浏览自定义目录时,把 JSON 路径或 URL 传给 /plugins marketplace <source>;或通过 KIMI_CODE_PLUGIN_MARKETPLACE_URL 覆盖默认 marketplace。plugins 数组中每个条目需要 id 和 source(本地路径、zip URL 或 GitHub URL):
{
"version": "2",
"plugins": [
{
"id": "my-plugin",
"displayName": "My Plugin",
"source": "./my-plugin"
}
]
}
Kimi Datasource
Kimi Datasource 是 Kimi Code 官方数据插件,让你通过自然语言直接查询金融行情、宏观经济、企业工商、学术文献和中国法律法规,无需手动调用接口或申请任何数据账号。
安装
需先通过 /login 完成 Kimi Code 账号 OAuth 登录,插件依赖本地凭据访问数据服务。
- 运行
/plugins,选择 Official - 找到 Kimi Datasource,按
Enter安装 - 安装完成后运行
/reload或/new激活 plugin
当前最新版本为 v3.2.0。插件安装后不会自动更新,如需升级到新版本,重新执行上述安装步骤即可。
使用方式
安装完成后,直接用自然语言描述你的需求,Kimi Code 会自动调用数据能力;也可以通过 /skill:kimi-datasource 明确触发数据查询 Skill。
能做什么
实时量化研究:盯着茅台想做个量化分析?一句话拉取近三年的每日收盘价、MACD 和 KDJ 信号,直接出结论,不用找第三方数据平台。
跨国宏观对比:研究中印越产业转移?基于世界银行 50 年历史数据,一次查询拿到三国 GDP 增速、贸易额、人口结构的完整时间序列对比。
合同前风险排查:签合同前五分钟才想起来要查对方背景?输入公司名,立刻拿到工商注册信息、股权穿透、司法纠纷和失信记录,当场决策。
文献综述加速:写论文要梳理 RLHF 领域的研究脉络?直接列出高引论文、主要作者和核心结论,综述提纲半小时内成型。
法律条文速查:碰上居住权的合同纠纷,拿不准法条?一句话定位《民法典》相关条文原文、效力级别和时效性,再顺手拉几个相近判例佐证,不用翻法规库。
数据覆盖
| 类别 | 覆盖范围 |
|---|---|
| 股票行情 | A 股、港股、美股及全球主要市场实时/历史行情、技术指标、财务报表、股票筛选 |
| 宏观经济 | 世界银行 189 个成员国、50 年以上历史时间序列(GDP、贸易、人口、气候等) |
| 企业数据 | 中国大陆境内企业工商信息、股权穿透、司法风险、关联图谱 |
| 学术文献 | 物理、数学、计算机、金融、经济等领域百万量级论文,支持预印本查询 |
| 法律法规 | 中国法律法规与司法案例:宪法、法律、司法解释、部门规章等各效力层次的法规语义/关键词检索与详情,普通及权威判例检索 |
计费与限制
- 数据查询按次计费,消耗 Kimi Code 账号额度
- 插件为只读查询,不提供任何写入或交易功能
- 技术指标(MACD、KDJ 等)及实时行情仅在交易时段内可用
- AI 输出内容仅供参考,不构成任何投资或商业决策建议
Plugin manifest
Plugin 是一个带 manifest 的目录或 zip 文件。Manifest 可以放在以下任一位置:
<plugin_root>/kimi.plugin.json
<plugin_root>/.kimi-plugin/plugin.json
两个文件同时存在时,以 kimi.plugin.json 为准。
示例:
{
"name": "kimi-finance",
"version": "1.0.0",
"description": "Finance data and analysis workflows for Kimi Code CLI",
"skills": "./skills/",
"sessionStart": {
"skill": "using-finance"
},
"interface": {
"displayName": "Kimi Finance",
"shortDescription": "Market data and financial analysis workflows"
}
}
支持的字段:
| 字段 | 说明 |
|---|---|
name |
必填,作为 plugin id。必须匹配 [a-z0-9][a-z0-9_-]{0,63} |
version、description、keywords、author、homepage、license |
展示元数据 |
interface |
在 /plugins 中展示的字段:displayName、shortDescription、longDescription、developerName、websiteURL |
skills |
一个或多个 ./ 路径,必须位于 plugin 根目录内。省略时根目录的 SKILL.md 被当作单个 Skill root |
sessionStart.skill |
在新会话或恢复会话开始时,把指定 plugin Skill 加载到主 Agent |
skillInstructions |
每次加载此 plugin 的 Skill 时一并附带的额外说明 |
mcpServers |
MCP server 声明,默认启用,可从 /plugins 中禁用 |
tools、commands、hooks、apps、inject、configFile 等不支持的运行时字段会显示为 diagnostics 并被忽略。
Skills 与会话启动
Plugin Skills 使用与普通 Agent Skills 相同的 SKILL.md 格式,典型目录结构如下:
my-plugin/
kimi.plugin.json
skills/
using-my-plugin/
SKILL.md
another-workflow/
SKILL.md
sessionStart.skill 在会话启动时把一个 plugin Skill 加载到主 Agent,适合放置初始化说明、工作流规则,或把其他工具中的术语映射到 Kimi Code CLI。它只注入文本,不执行代码。
无论 Skill 通过哪种方式加载(sessionStart.skill、/skill:<name> 或模型自动调用),skillInstructions 都会随该 plugin 的 Skill 一起出现。
Plugin 中的 MCP servers
当 plugin 需要真实工具能力时,可以在 manifest 中声明 mcpServers,复用 MCP 的 schema。
Stdio server(本地命令):
{
"mcpServers": {
"finance": {
"command": "uvx",
"args": ["kimi-finance-mcp"]
}
}
}
HTTP server(远程服务):
{
"mcpServers": {
"docs": {
"url": "https://example.com/mcp"
}
}
}
对于 stdio servers,command 可以是 PATH 上的命令,也可以是 plugin 根目录内以 ./ 开头的路径。cwd 同理,必须以 ./ 开头并位于 plugin 根目录内,否则该 server 会被忽略。
Plugin MCP servers 会在 /reload 后或新会话中启动。启用或禁用某个 server:
/plugins mcp disable kimi-finance finance
/reload
/plugins mcp enable kimi-finance finance
/reload
安全模型
Plugin 的加载范围有限,以下操作不会在安装或会话启动时发生:
- 不会执行命令型 plugin tools、hooks 或旧式工具运行时
- 所有路径在解析符号链接后仍必须位于 plugin 根目录内
- 已启用 plugin 的 MCP servers 会在
/reload后或新会话中启动,且可随时从/plugins禁用 - 损坏的 manifest 或不安全路径会显示在
/plugins info <id>的 diagnostics 中,不影响其他会话