nanocode-cli 0.7.2__tar.gz → 0.8.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nanocode-cli
3
- Version: 0.7.2
3
+ Version: 0.8.1
4
4
  Summary: A small terminal coding agent written in Python
5
5
  Author-email: hit9 <hit9@icloud.com>
6
6
  License-Expression: BSD-3-Clause
@@ -104,6 +104,7 @@ Useful arguments:
104
104
  - `--mcp <selector>`: choose which configured MCP servers to enable.
105
105
  - `--debug`: write model I/O debug traces.
106
106
  - `-v`, `--version`: show the version.
107
+ - `update` / `upgrade`: update nanocode to the latest release, using the right installer (uv tool, pipx, or pip) for how it was installed.
107
108
 
108
109
  During a running turn, type into the `+>` prompt to add follow-up input for the next model request.
109
110
 
@@ -131,6 +132,8 @@ Commands:
131
132
 
132
133
  - `/help`: show commands and tools.
133
134
  - `/status`: show runtime status, including the active session id.
135
+ - `/context [PATH]`: show the model's context frame — environment, memory (goal, plan, known facts, check), and file state; `PATH` shows that file's current in-context lines.
136
+ - `/skills`: list installed skills (load with `Skill(name)` or reference inline with `$name`).
134
137
  - `/config`: show active config.
135
138
  - `/api [auto|chat|anthropic]`: show or set provider API format.
136
139
  - `/debug [on|off]`: toggle model I/O debug traces.
@@ -140,6 +143,7 @@ Commands:
140
143
  - `/provider [NAME]`: show or set provider.
141
144
  - `/model [MODEL]`: show or set model.
142
145
  - `/reason`: choose reasoning effort.
146
+ - `/strict`: toggle strict tool-call schemas (OpenAI / DeepSeek only).
143
147
  - `/set KEY VALUE`: set supported provider/runtime values for the current session.
144
148
  - `/yolo`: toggle tool confirmations.
145
149
  - `/exit`, `/quit`: exit.
@@ -156,6 +160,7 @@ Tools:
156
160
  - Working notes: `Note`.
157
161
  - Ask the user: `Question`.
158
162
  - MCP: `MCP`.
163
+ - Skills: `Skill` loads a skill's full instructions on demand (offered whenever any skill exists — the built-in `nanocode-help` means it is normally always available).
159
164
 
160
165
  `Read`, `Search`, and `InspectCode` return line anchors where useful. `Edit` uses current `line:hash` anchors to reject stale edits.
161
166
 
@@ -170,12 +175,14 @@ Default config location:
170
175
  Main fields:
171
176
 
172
177
  - `[provider] active = "name"`
173
- - `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `timeout`
178
+ - `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `max_tokens`, `strict_tools`, `timeout`
174
179
  - `[paths] data_dir`
175
- - `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`
180
+ - `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `max_parallel_tools`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`, `tips`
176
181
 
177
182
  `api = "auto"` chooses between Chat Completions and Anthropic Messages using provider/model profiles. `prompt_cache_key = "auto"` derives a stable key from provider, model, workspace, and tool schema names.
178
183
 
184
+ `strict_tools = true` (toggle with `/strict`) constrains tool-call arguments to each tool's JSON schema. It only takes effect on hosts that support it (OpenAI and DeepSeek) and on the Chat Completions path; it is a no-op elsewhere. For DeepSeek, enabling it routes requests to the `/beta` endpoint. Tools whose schemas can't be represented under strict function calling fall back to non-strict automatically.
185
+
179
186
  Runtime flags such as `--yolo`, `--debug`, and `--mcp` apply to resumed sessions too. Saved sessions do not carry their old runtime config forward.
180
187
 
181
188
  ## MCP
@@ -215,6 +222,37 @@ Manage servers at runtime:
215
222
  - `/mcp refresh [server]`: rediscover servers.
216
223
  - `/mcp login <server>` / `/mcp logout <server>`: OAuth login and logout.
217
224
 
225
+ ## Skills
226
+
227
+ Skills are reusable instruction packs the agent can pull in on demand. Each skill is a folder with a `SKILL.md`:
228
+
229
+ ```text
230
+ .nanocode/skills/ # project skills (travel with the repo)
231
+ release-notes/
232
+ SKILL.md
233
+ scripts/
234
+ collect_commits.py
235
+ ~/.nanocode/skills/ # personal skills (all projects)
236
+ ```
237
+
238
+ `SKILL.md` has `name`/`description` frontmatter and a Markdown body of instructions:
239
+
240
+ ```markdown
241
+ ---
242
+ name: release-notes
243
+ description: Draft a CHANGELOG entry from commits since the last release.
244
+ ---
245
+ Run `python "{skill_dir}/scripts/collect_commits.py" <last-tag>` to gather commits,
246
+ then group them by type and write entries in the house style.
247
+ ```
248
+
249
+ - **Discovery**: `.nanocode/skills/` (project) and `~/.nanocode/skills/` (user). On a name clash the project skill wins.
250
+ - **How the model sees them**: only a compact `SKILLS` index (name + description) sits in context; the full body is loaded on demand when the model calls `Skill(name)`. A repeated load of the same skill collapses to a pointer so the instructions are not re-billed. When no skills are installed, nothing is added to the prompt.
251
+ - **Reference one inline**: type `$name` in your message (Tab-completes) to nudge the model to use that skill; its instructions are injected for that turn.
252
+ - **Bundled scripts**: `{skill_dir}` (or `${SKILL_DIR}`) in the body expands to the skill's absolute folder path, so the model can run bundled scripts via `Bash` (subject to normal confirmation unless `/yolo`).
253
+ - **Inspect**: `/skills` lists installed skills; the status bar and `/status` show the count.
254
+ - **Built-in**: a `nanocode-help` skill ships by default and carries a self-contained manual — authored prose on how to use nanocode, its features, and common problems, plus command/tool/config lists assembled from nanocode's own `/help` text, tool descriptions, and config keys. So "how do I / what does X / why is Y" questions are answered from the manual without searching the source, and the lists can't drift from the running version. Drop a `nanocode-help` skill of your own to override it.
255
+
218
256
  ## Providers
219
257
 
220
258
  The following providers have been tested with nanocode:
@@ -67,6 +67,7 @@ Useful arguments:
67
67
  - `--mcp <selector>`: choose which configured MCP servers to enable.
68
68
  - `--debug`: write model I/O debug traces.
69
69
  - `-v`, `--version`: show the version.
70
+ - `update` / `upgrade`: update nanocode to the latest release, using the right installer (uv tool, pipx, or pip) for how it was installed.
70
71
 
71
72
  During a running turn, type into the `+>` prompt to add follow-up input for the next model request.
72
73
 
@@ -94,6 +95,8 @@ Commands:
94
95
 
95
96
  - `/help`: show commands and tools.
96
97
  - `/status`: show runtime status, including the active session id.
98
+ - `/context [PATH]`: show the model's context frame — environment, memory (goal, plan, known facts, check), and file state; `PATH` shows that file's current in-context lines.
99
+ - `/skills`: list installed skills (load with `Skill(name)` or reference inline with `$name`).
97
100
  - `/config`: show active config.
98
101
  - `/api [auto|chat|anthropic]`: show or set provider API format.
99
102
  - `/debug [on|off]`: toggle model I/O debug traces.
@@ -103,6 +106,7 @@ Commands:
103
106
  - `/provider [NAME]`: show or set provider.
104
107
  - `/model [MODEL]`: show or set model.
105
108
  - `/reason`: choose reasoning effort.
109
+ - `/strict`: toggle strict tool-call schemas (OpenAI / DeepSeek only).
106
110
  - `/set KEY VALUE`: set supported provider/runtime values for the current session.
107
111
  - `/yolo`: toggle tool confirmations.
108
112
  - `/exit`, `/quit`: exit.
@@ -119,6 +123,7 @@ Tools:
119
123
  - Working notes: `Note`.
120
124
  - Ask the user: `Question`.
121
125
  - MCP: `MCP`.
126
+ - Skills: `Skill` loads a skill's full instructions on demand (offered whenever any skill exists — the built-in `nanocode-help` means it is normally always available).
122
127
 
123
128
  `Read`, `Search`, and `InspectCode` return line anchors where useful. `Edit` uses current `line:hash` anchors to reject stale edits.
124
129
 
@@ -133,12 +138,14 @@ Default config location:
133
138
  Main fields:
134
139
 
135
140
  - `[provider] active = "name"`
136
- - `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `timeout`
141
+ - `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `max_tokens`, `strict_tools`, `timeout`
137
142
  - `[paths] data_dir`
138
- - `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`
143
+ - `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `max_parallel_tools`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`, `tips`
139
144
 
140
145
  `api = "auto"` chooses between Chat Completions and Anthropic Messages using provider/model profiles. `prompt_cache_key = "auto"` derives a stable key from provider, model, workspace, and tool schema names.
141
146
 
147
+ `strict_tools = true` (toggle with `/strict`) constrains tool-call arguments to each tool's JSON schema. It only takes effect on hosts that support it (OpenAI and DeepSeek) and on the Chat Completions path; it is a no-op elsewhere. For DeepSeek, enabling it routes requests to the `/beta` endpoint. Tools whose schemas can't be represented under strict function calling fall back to non-strict automatically.
148
+
142
149
  Runtime flags such as `--yolo`, `--debug`, and `--mcp` apply to resumed sessions too. Saved sessions do not carry their old runtime config forward.
143
150
 
144
151
  ## MCP
@@ -178,6 +185,37 @@ Manage servers at runtime:
178
185
  - `/mcp refresh [server]`: rediscover servers.
179
186
  - `/mcp login <server>` / `/mcp logout <server>`: OAuth login and logout.
180
187
 
188
+ ## Skills
189
+
190
+ Skills are reusable instruction packs the agent can pull in on demand. Each skill is a folder with a `SKILL.md`:
191
+
192
+ ```text
193
+ .nanocode/skills/ # project skills (travel with the repo)
194
+ release-notes/
195
+ SKILL.md
196
+ scripts/
197
+ collect_commits.py
198
+ ~/.nanocode/skills/ # personal skills (all projects)
199
+ ```
200
+
201
+ `SKILL.md` has `name`/`description` frontmatter and a Markdown body of instructions:
202
+
203
+ ```markdown
204
+ ---
205
+ name: release-notes
206
+ description: Draft a CHANGELOG entry from commits since the last release.
207
+ ---
208
+ Run `python "{skill_dir}/scripts/collect_commits.py" <last-tag>` to gather commits,
209
+ then group them by type and write entries in the house style.
210
+ ```
211
+
212
+ - **Discovery**: `.nanocode/skills/` (project) and `~/.nanocode/skills/` (user). On a name clash the project skill wins.
213
+ - **How the model sees them**: only a compact `SKILLS` index (name + description) sits in context; the full body is loaded on demand when the model calls `Skill(name)`. A repeated load of the same skill collapses to a pointer so the instructions are not re-billed. When no skills are installed, nothing is added to the prompt.
214
+ - **Reference one inline**: type `$name` in your message (Tab-completes) to nudge the model to use that skill; its instructions are injected for that turn.
215
+ - **Bundled scripts**: `{skill_dir}` (or `${SKILL_DIR}`) in the body expands to the skill's absolute folder path, so the model can run bundled scripts via `Bash` (subject to normal confirmation unless `/yolo`).
216
+ - **Inspect**: `/skills` lists installed skills; the status bar and `/status` show the count.
217
+ - **Built-in**: a `nanocode-help` skill ships by default and carries a self-contained manual — authored prose on how to use nanocode, its features, and common problems, plus command/tool/config lists assembled from nanocode's own `/help` text, tool descriptions, and config keys. So "how do I / what does X / why is Y" questions are answered from the manual without searching the source, and the lists can't drift from the running version. Drop a `nanocode-help` skill of your own to override it.
218
+
181
219
  ## Providers
182
220
 
183
221
  The following providers have been tested with nanocode:
@@ -67,6 +67,7 @@ nanocode
67
67
  - `--mcp <selector>`:选择启用哪些已配置的 MCP 服务器。
68
68
  - `--debug`:写入模型 I/O debug trace。
69
69
  - `-v`, `--version`:显示版本。
70
+ - `update` / `upgrade`:将 nanocode 更新到最新版本,并根据安装方式(uv tool、pipx 或 pip)选择正确的升级方式。
70
71
 
71
72
  代理运行中,可以在 `+>` 提示符里输入追加内容,发送到下一次模型请求。
72
73
 
@@ -94,6 +95,8 @@ nanocode --resume last
94
95
 
95
96
  - `/help`:显示命令和工具。
96
97
  - `/status`:显示运行状态,包括当前 session id。
98
+ - `/context [PATH]`:显示模型的上下文帧——环境、记忆(goal、plan、known facts、check)和文件状态;`PATH` 显示该文件当前在上下文中的行。
99
+ - `/skills`:列出已安装的 skills(用 `Skill(name)` 加载,或在消息中用 `$name` 引用)。
97
100
  - `/config`:显示当前配置。
98
101
  - `/api [auto|chat|anthropic]`:显示或设置 provider API 格式。
99
102
  - `/debug [on|off]`:切换模型 I/O debug trace。
@@ -103,6 +106,7 @@ nanocode --resume last
103
106
  - `/provider [NAME]`:显示或设置 provider。
104
107
  - `/model [MODEL]`:显示或设置模型。
105
108
  - `/reason`:选择 reasoning effort。
109
+ - `/strict`:切换严格工具调用 schema(仅 OpenAI / DeepSeek)。
106
110
  - `/set KEY VALUE`:设置当前 session 支持的 provider/runtime 值。
107
111
  - `/yolo`:切换工具确认。
108
112
  - `/exit`, `/quit`:退出。
@@ -119,6 +123,7 @@ nanocode --resume last
119
123
  - 工作笔记:`Note`。
120
124
  - 询问用户:`Question`。
121
125
  - MCP:`MCP`。
126
+ - Skills:`Skill` 按需加载某个 skill 的完整说明(只要存在任一 skill 即提供——内置的 `nanocode-help` 意味着它通常始终可用)。
122
127
 
123
128
  `Read`、`Search` 和 `InspectCode` 会在合适时返回行锚点。`Edit` 使用当前 `line:hash` 锚点拒绝过期编辑。
124
129
 
@@ -133,12 +138,14 @@ nanocode --resume last
133
138
  主要字段:
134
139
 
135
140
  - `[provider] active = "name"`
136
- - `[provider.<name>]`:`url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `timeout`
141
+ - `[provider.<name>]`:`url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `max_tokens`, `strict_tools`, `timeout`
137
142
  - `[paths] data_dir`
138
- - `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`
143
+ - `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `max_parallel_tools`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`, `tips`
139
144
 
140
145
  `api = "auto"` 会根据 provider/model profile 在 Chat Completions 和 Anthropic Messages 之间选择。`prompt_cache_key = "auto"` 会根据 provider、model、workspace 和工具 schema 名称生成稳定 key。
141
146
 
147
+ `strict_tools = true`(用 `/strict` 切换)会将工具调用参数约束到每个工具的 JSON schema。它仅在支持该特性的 host(OpenAI 和 DeepSeek)以及 Chat Completions 路径上生效,其他情况下为空操作。对 DeepSeek,启用后请求会路由到 `/beta` 端点。无法在严格函数调用下表示的工具 schema 会自动回退到非严格模式。
148
+
142
149
  `--yolo`、`--debug` 和 `--mcp` 等 runtime flags 对恢复的 session 同样生效。保存的 session 不会携带旧 runtime config。
143
150
 
144
151
  ## MCP
@@ -178,6 +185,37 @@ HTTP 鉴权选项(`auth`、`bearer_token_env_var`、`env_http_headers`)只
178
185
  - `/mcp refresh [server]`:重新发现服务器。
179
186
  - `/mcp login <server>` / `/mcp logout <server>`:OAuth 登录和登出。
180
187
 
188
+ ## Skills
189
+
190
+ Skills 是可复用的指令包,agent 可按需加载。每个 skill 是一个包含 `SKILL.md` 的文件夹:
191
+
192
+ ```text
193
+ .nanocode/skills/ # 项目 skills(随仓库一起提交)
194
+ release-notes/
195
+ SKILL.md
196
+ scripts/
197
+ collect_commits.py
198
+ ~/.nanocode/skills/ # 个人 skills(对所有项目生效)
199
+ ```
200
+
201
+ `SKILL.md` 带有 `name`/`description` 前置元数据,正文是 Markdown 指令:
202
+
203
+ ```markdown
204
+ ---
205
+ name: release-notes
206
+ description: Draft a CHANGELOG entry from commits since the last release.
207
+ ---
208
+ 运行 `python "{skill_dir}/scripts/collect_commits.py" <last-tag>` 收集提交,
209
+ 再按类型分组并以项目既有风格撰写条目。
210
+ ```
211
+
212
+ - **发现路径**:`.nanocode/skills/`(项目)和 `~/.nanocode/skills/`(用户)。同名时项目 skill 优先。
213
+ - **模型如何看到**:上下文中只放一个精简的 `SKILLS` 索引(name + description);完整正文仅在模型调用 `Skill(name)` 时按需加载。对同一 skill 的重复加载会折叠为一行指针,避免重复计费。未安装任何 skill 时不会向 prompt 添加内容。
214
+ - **内联引用**:在消息中输入 `$name`(支持 Tab 补全)以提示模型使用该 skill;其指令会为该轮注入。
215
+ - **随附脚本**:正文中的 `{skill_dir}`(或 `${SKILL_DIR}`)会展开为该 skill 的绝对目录路径,模型可通过 `Bash` 运行随附脚本(除非 `/yolo`,否则仍需正常确认)。
216
+ - **查看**:`/skills` 列出已安装的 skills;状态栏和 `/status` 会显示数量。
217
+ - **内置**:默认自带 `nanocode-help` skill,其正文是一份自包含手册——包含关于如何使用 nanocode、其功能和常见问题的成文说明,外加由 nanocode 自身的 `/help` 文本、工具描述和配置项在加载时拼装而成的命令/工具/配置清单。因此“怎么用 / X 是什么 / 为什么 Y”这类问题可直接从手册回答,无需检索源码,且清单不会与运行版本脱节。放置同名 `nanocode-help` skill 即可覆盖它。
218
+
181
219
  ## Providers
182
220
 
183
221
  以下 provider 已在 nanocode 中测试通过: