@cnbcool/cnb-cli 1.9.8 → 1.10.1

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.
Files changed (3) hide show
  1. package/README.md +43 -70
  2. package/dist/index.js +60 -60
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,31 +1,17 @@
1
1
  # CNB Skills
2
2
 
3
- CNB 平台技能集合,基于开放的 Agent Skills 生态,不仅支持 CodeBuddy,也支持 Claude Code、Codex、Cursor、Gemini CLI、OpenCode、Qwen Code、Windsurf 等多种 Agent,通过 `npx skills` 一键安装。
3
+ CNB 平台技能集合,支持多种主流 Agent,通过 `npx skills` 一键安装。
4
4
 
5
- ## 安装方式
6
-
7
- ### 安装到指定 Agent
8
-
9
- 使用 `--agent` 指定目标 Agent;不指定时,`skills` 会自动检测本机已安装的 Agent 并提示选择。
5
+ ## 快速开始
10
6
 
11
7
  ```bash
12
- # 安装到 CodeBuddy
13
- npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent codebuddy -y
14
-
15
- # 安装到 Claude Code
16
- npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent claude-code -y
17
-
18
- # 安装到 Codex
19
- npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent codex -y
20
-
21
- # 同时安装到多个 Agent
22
- npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent codebuddy --agent claude-code --agent cursor -y
23
-
24
- # 安装到所有支持的 Agent
25
- npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent '*' -y
8
+ # 推荐:全局安装所有 Skills,对所有 Agent 生效
9
+ npx skills add https://cnb.cool/cnb/skills/cnb-skill.git -g -y
26
10
  ```
27
11
 
28
- 常用 Agent 参数示例:
12
+ 安装后所有 CNB Skills 即可在任意 Agent 中使用。
13
+
14
+ ## 支持的 Agent
29
15
 
30
16
  | Agent | `--agent` |
31
17
  | --- | --- |
@@ -38,49 +24,53 @@ npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent '*' -y
38
24
  | Qwen Code | `qwen-code` |
39
25
  | Windsurf | `windsurf` |
40
26
 
27
+ ## 更多安装方式
28
+
29
+ ### 安装到指定 Agent
30
+
31
+ ```bash
32
+ # 安装到 CodeBuddy(不指定 --agent 时会自动检测并提示选择)
33
+ npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent codebuddy -y
34
+
35
+ # 同时安装到多个 Agent
36
+ npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent codebuddy --agent claude-code -y
37
+
38
+ # 安装到所有支持的 Agent
39
+ npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent '*' -y
40
+ ```
41
+
41
42
  ### 只安装指定的 Skill
42
43
 
43
44
  ```bash
44
45
  # 查看仓库中可安装的 Skill
45
46
  npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --list
46
47
 
47
- # 安装指定 Skill 到 CodeBuddy
48
+ # 安装指定 Skill
48
49
  npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --skill cnb-api --agent codebuddy -y
49
-
50
- # 安装指定 Skill 到 Claude Code
51
- npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --skill cnb-api --agent claude-code -y
52
50
  ```
53
51
 
54
- ### 安装 cnb-cli
52
+ ---
53
+
54
+ ## 前置依赖
55
55
 
56
- 使用 skills 需先安装 cnb-cli,支持以下方式:
56
+ 使用 `npx skills` 需要安装 cnb-cli
57
57
 
58
58
  ```bash
59
- # 一键安装最新版(macOS / Linux
59
+ # macOS / Linux
60
60
  curl -fsSL https://cnb.cool/cnb/skills/cnb-skill/-/git/raw/main/install.sh | sh
61
61
 
62
- # 一键安装指定版本(macOS / Linux)
63
- curl -fsSL https://cnb.cool/cnb/skills/cnb-skill/-/git/raw/main/install.sh | sh -s 1.5.3
64
- ```
65
-
66
- ```powershell
67
- # 一键安装最新版(Windows PowerShell)
62
+ # Windows PowerShell
68
63
  irm https://cnb.cool/cnb/skills/cnb-skill/-/git/raw/main/install.ps1 | iex
69
64
 
70
- # 一键安装指定版本(Windows PowerShell)
71
- $v="1.5.3"; irm https://cnb.cool/cnb/skills/cnb-skill/-/git/raw/main/install.ps1 | iex
72
- ```
73
-
74
- ```bash
75
- # npm 安装
65
+ # npm
76
66
  npm install @cnbcool/cnb-cli -g
77
67
  ```
78
68
 
79
- 也可前往 [Releases](https://cnb.cool/cnb/skills/cnb-skill/-/releases) 手动下载(最新版直链:`https://cnb.cool/cnb/skills/cnb-skill/-/releases/latest/download/<filename>`)。
69
+ > 也可前往 [Releases](https://cnb.cool/cnb/skills/cnb-skill/-/releases) 手动下载。
80
70
 
81
71
  ## AI 安装提示词
82
72
 
83
- 将以下内容发送给 CodeBuddy、Claude Code、Codex、Cursor、Gemini CLI 等智能体即可自动安装;按需把 `--agent codebuddy` 替换为目标 Agent(如 `claude-code`、`codex`、`cursor`、`gemini-cli`、`opencode`、`qwen-code`、`windsurf`),或使用 `--agent '*'` 安装到所有支持的 Agent。
73
+ 将以下内容发送给 Agent 即可自动安装;按需替换 `--agent` 参数:
84
74
 
85
75
  ```
86
76
  npm install @cnbcool/cnb-cli -g
@@ -90,25 +80,23 @@ npx skills add https://cnb.cool/cnb/skills/cnb-skill.git --agent codebuddy -y --
90
80
 
91
81
  ## 环境变量
92
82
 
93
- - `CNB_TOKEN`:访问凭证(必须)
94
- - `CNB_API_ENDPOINT`:API 端点,如 `https://api.cnb.cool`(必须)
95
- - `CNB_BRANCH`:默认分支(选填)
83
+ | 变量 | 说明 | 必填 |
84
+ | --- | --- | --- |
85
+ | `CNB_TOKEN` | 访问凭证 | 是 |
86
+ | `CNB_API_ENDPOINT` | API 端点,如 `https://api.cnb.cool` | 是 |
87
+ | `CNB_BRANCH` | 默认分支 | 否 |
96
88
 
97
- ## cnb git-credential 使用说明
89
+ ## cnb git-credential
98
90
 
99
- `cnb git-credential` 可作为 Git Credential Helper,为 `git clone`、`git pull`、`git push`、Git LFS 等 HTTPS 操作自动提供 CNB 访问凭据。
91
+ `cnb git-credential` 可作为 Git Credential Helper,为 HTTPS 操作自动提供 CNB 访问凭据。
100
92
 
101
- ### 1. 登录 CNB
93
+ ### 1. 登录
102
94
 
103
95
  ```bash
104
96
  cnb login
105
97
  ```
106
98
 
107
- 登录成功后,凭据会保存到 `~/.cnb/token`。后续 Git 操作会自动读取该凭据;若 token 过期且存在 `refresh_token`,会自动刷新。
108
-
109
- ### 2. 配置 Git Credential Helper
110
-
111
- 推荐只为 CNB 域名配置 helper,避免影响其他 Git 站点:
99
+ ### 2. 配置 Git
112
100
 
113
101
  ```bash
114
102
  git config --global credential.https://cnb.cool.helper ""
@@ -116,18 +104,7 @@ git config --global credential.https://cnb.cool.helper "!cnb git-credential"
116
104
  git config --global credential.https://cnb.cool.useHttpPath true
117
105
  ```
118
106
 
119
- 也可以直接在 `~/.gitconfig` 中加入:
120
-
121
- ```ini
122
- [credential "https://cnb.cool"]
123
- helper =
124
- helper = "!cnb git-credential"
125
- useHttpPath = true
126
- ```
127
-
128
- > **注意**:第一行空的 `helper =` 用于清除全局 `[credential]` 段继承的 helper(如 Git Credential Manager),确保只使用 cnb 的 credential helper。如果你没有配置其他全局 credential helper,可以省略这一行。
129
-
130
- ### 3. 使用 HTTPS 地址操作仓库
107
+ ### 3. 使用 HTTPS 操作
131
108
 
132
109
  ```bash
133
110
  git clone https://cnb.cool/<org>/<repo>.git
@@ -136,8 +113,4 @@ git pull
136
113
  git push
137
114
  ```
138
115
 
139
- 说明:
140
-
141
- - `cnb git-credential` 仅供 Git 内部调用;通常无需手动执行。
142
- - 凭据来源优先级:CodeBuddy 环境 token、`CNB_TOKEN` 环境变量、`~/.cnb/token` 登录凭据。
143
- - 如需取消配置,可执行:`git config --global --unset credential.https://cnb.cool.helper`。
116
+ > 凭据来源优先级:CodeBuddy 环境 token → `CNB_TOKEN` 环境变量 → `~/.cnb/token` 登录凭据。