@cnbcool/cnb-cli 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -74,6 +74,7 @@ The platform and repo are inferred from the `cwd` git remote (`cnb_run`, `cnb_st
74
74
  The cli usage conventions ship inside the MCP instructions and tool descriptions, always matching the cli version. Tools:
75
75
 
76
76
  - `cnb_run` — run a cnb command; arguments are passed as an array without a shell; pass `cwd` to infer the repo from a workspace
77
+ - `cnb_skill` — platform knowledge base on demand: no arguments lists the bundled skills, `query` searches them, `name` (+ `path` for a sub-file) returns the content
77
78
  - `cnb_login` — OAuth2 device authorization, returns an auth link; the token is shared with `cnb login` in `~/.cnb/token`
78
79
  - `cnb_status` / `cnb_logout` — check or clear the login
79
80
 
package/README.md CHANGED
@@ -100,12 +100,15 @@ cli 的用法约定(常用命令、参数、输出约定)随包内置在 MCP
100
100
  | 工具 | 作用 | 参数 |
101
101
  | --- | --- | --- |
102
102
  | `cnb_run` | 执行任意 `cnb` 命令,覆盖 Issues / PR / 仓库 / 构建 / 制品库等全部 OpenAPI 操作 | `args`:`cnb` 之后的参数数组;`cwd`:工作区绝对路径 |
103
+ | `cnb_skill` | 平台知识库:按需返回写 `.cnb.yml`、评审 PR、提交规范、附件上传、查官方文档的判断口径 | `query`:关键词检索;`name` + `path`:取指定技能与分册 |
103
104
  | `cnb_status` | 查看登录状态,过期时自动用 refresh_token 刷新 | `cwd` |
104
105
  | `cnb_login` | OAuth2 设备授权登录,返回授权链接,token 写入 `~/.cnb/token` | `cwd` |
105
106
  | `cnb_logout` | 退出登录,删除本机对应平台的登录态 | `cwd` |
106
107
 
107
108
  `cnb_run` 的 `args` 按数组原样传给 cli、不经过 shell:多行正文直接作为一个元素传入(如 `["issues","comment","--number","12","--body","第一行\n第二行"]`),无需引号或转义。`login`、`mcp` 两个子命令被拦截,登录请用 `cnb_login`。
108
109
 
110
+ `cnb_skill` 按需取内容,不占常驻上下文:不传参数列出全部技能;`{"query":"定时任务 怎么配"}` 返回命中片段;`{"name":"cnb-pipeline"}` 取主干并列出分册;`{"name":"cnb-pipeline","path":"references/crontab.md"}` 取具体分册。
111
+
109
112
  ### 自动推断
110
113
 
111
114
  - **平台**:启动参数 `--host` → `cwd` 的 git remote → `CNB_API_ENDPOINT` → `cnb.cool`。推断出的平台同时决定 API 域名和读取哪份登录态
@@ -127,7 +130,9 @@ cli 的用法约定(常用命令、参数、输出约定)随包内置在 MCP
127
130
 
128
131
  MCP 覆盖 cli 的全部命令能力,相当于「cnb-api skill + cli」,不需要再安装 skills。
129
132
 
130
- 但 `cnb-code-review`、`cnb-code-commit`、`cnb-pipeline` 等 skill 的价值在流程知识(评审标准、提交规范、`.cnb.yml` 语法),cli 里没有这部分。需要这些能力时,仍按上文安装对应 skills,或让 Agent 直接读取仓库里的 `SKILL.md`。
133
+ 流程知识以 `cnb_skill` 的形式内置:取自仓库 `skills/` 下的 `cnb-pipeline`、`cnb-code-review`、`cnb-code-commit`、`cnb-upload-attachment`、`cnb-docs`,随包版本更新,按需检索与取用。
134
+
135
+ 安装 skills 仍然适用:不配 MCP、在本地直接用 Agent 干活时;或需要 `cnb-npc-search`、`cnb-tapd-resource-fetcher` 等未内置的技能。
131
136
 
132
137
  ### 认证与安全
133
138