nanocode-cli 0.7.1__tar.gz → 0.8.0__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.
- {nanocode_cli-0.7.1/nanocode_cli.egg-info → nanocode_cli-0.8.0}/PKG-INFO +40 -3
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/README.md +39 -2
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/README.zh-CN.md +39 -2
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/nanocode.py +952 -94
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0/nanocode_cli.egg-info}/PKG-INFO +40 -3
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/pyproject.toml +1 -1
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/LICENSE +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/MANIFEST.in +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/nanocode_cli.egg-info/SOURCES.txt +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/nanocode_cli.egg-info/dependency_links.txt +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/nanocode_cli.egg-info/entry_points.txt +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/nanocode_cli.egg-info/requires.txt +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/nanocode_cli.egg-info/top_level.txt +0 -0
- {nanocode_cli-0.7.1 → nanocode_cli-0.8.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nanocode-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
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
|
|
@@ -131,6 +131,8 @@ Commands:
|
|
|
131
131
|
|
|
132
132
|
- `/help`: show commands and tools.
|
|
133
133
|
- `/status`: show runtime status, including the active session id.
|
|
134
|
+
- `/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.
|
|
135
|
+
- `/skills`: list installed skills (load with `Skill(name)` or reference inline with `$name`).
|
|
134
136
|
- `/config`: show active config.
|
|
135
137
|
- `/api [auto|chat|anthropic]`: show or set provider API format.
|
|
136
138
|
- `/debug [on|off]`: toggle model I/O debug traces.
|
|
@@ -140,6 +142,7 @@ Commands:
|
|
|
140
142
|
- `/provider [NAME]`: show or set provider.
|
|
141
143
|
- `/model [MODEL]`: show or set model.
|
|
142
144
|
- `/reason`: choose reasoning effort.
|
|
145
|
+
- `/strict`: toggle strict tool-call schemas (OpenAI / DeepSeek only).
|
|
143
146
|
- `/set KEY VALUE`: set supported provider/runtime values for the current session.
|
|
144
147
|
- `/yolo`: toggle tool confirmations.
|
|
145
148
|
- `/exit`, `/quit`: exit.
|
|
@@ -156,6 +159,7 @@ Tools:
|
|
|
156
159
|
- Working notes: `Note`.
|
|
157
160
|
- Ask the user: `Question`.
|
|
158
161
|
- MCP: `MCP`.
|
|
162
|
+
- 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
163
|
|
|
160
164
|
`Read`, `Search`, and `InspectCode` return line anchors where useful. `Edit` uses current `line:hash` anchors to reject stale edits.
|
|
161
165
|
|
|
@@ -170,12 +174,14 @@ Default config location:
|
|
|
170
174
|
Main fields:
|
|
171
175
|
|
|
172
176
|
- `[provider] active = "name"`
|
|
173
|
-
- `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `timeout`
|
|
177
|
+
- `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `max_tokens`, `strict_tools`, `timeout`
|
|
174
178
|
- `[paths] data_dir`
|
|
175
|
-
- `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`
|
|
179
|
+
- `[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
180
|
|
|
177
181
|
`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
182
|
|
|
183
|
+
`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.
|
|
184
|
+
|
|
179
185
|
Runtime flags such as `--yolo`, `--debug`, and `--mcp` apply to resumed sessions too. Saved sessions do not carry their old runtime config forward.
|
|
180
186
|
|
|
181
187
|
## MCP
|
|
@@ -215,6 +221,37 @@ Manage servers at runtime:
|
|
|
215
221
|
- `/mcp refresh [server]`: rediscover servers.
|
|
216
222
|
- `/mcp login <server>` / `/mcp logout <server>`: OAuth login and logout.
|
|
217
223
|
|
|
224
|
+
## Skills
|
|
225
|
+
|
|
226
|
+
Skills are reusable instruction packs the agent can pull in on demand. Each skill is a folder with a `SKILL.md`:
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
.nanocode/skills/ # project skills (travel with the repo)
|
|
230
|
+
release-notes/
|
|
231
|
+
SKILL.md
|
|
232
|
+
scripts/
|
|
233
|
+
collect_commits.py
|
|
234
|
+
~/.nanocode/skills/ # personal skills (all projects)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
`SKILL.md` has `name`/`description` frontmatter and a Markdown body of instructions:
|
|
238
|
+
|
|
239
|
+
```markdown
|
|
240
|
+
---
|
|
241
|
+
name: release-notes
|
|
242
|
+
description: Draft a CHANGELOG entry from commits since the last release.
|
|
243
|
+
---
|
|
244
|
+
Run `python "{skill_dir}/scripts/collect_commits.py" <last-tag>` to gather commits,
|
|
245
|
+
then group them by type and write entries in the house style.
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
- **Discovery**: `.nanocode/skills/` (project) and `~/.nanocode/skills/` (user). On a name clash the project skill wins.
|
|
249
|
+
- **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.
|
|
250
|
+
- **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.
|
|
251
|
+
- **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`).
|
|
252
|
+
- **Inspect**: `/skills` lists installed skills; the status bar and `/status` show the count.
|
|
253
|
+
- **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.
|
|
254
|
+
|
|
218
255
|
## Providers
|
|
219
256
|
|
|
220
257
|
The following providers have been tested with nanocode:
|
|
@@ -94,6 +94,8 @@ Commands:
|
|
|
94
94
|
|
|
95
95
|
- `/help`: show commands and tools.
|
|
96
96
|
- `/status`: show runtime status, including the active session id.
|
|
97
|
+
- `/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.
|
|
98
|
+
- `/skills`: list installed skills (load with `Skill(name)` or reference inline with `$name`).
|
|
97
99
|
- `/config`: show active config.
|
|
98
100
|
- `/api [auto|chat|anthropic]`: show or set provider API format.
|
|
99
101
|
- `/debug [on|off]`: toggle model I/O debug traces.
|
|
@@ -103,6 +105,7 @@ Commands:
|
|
|
103
105
|
- `/provider [NAME]`: show or set provider.
|
|
104
106
|
- `/model [MODEL]`: show or set model.
|
|
105
107
|
- `/reason`: choose reasoning effort.
|
|
108
|
+
- `/strict`: toggle strict tool-call schemas (OpenAI / DeepSeek only).
|
|
106
109
|
- `/set KEY VALUE`: set supported provider/runtime values for the current session.
|
|
107
110
|
- `/yolo`: toggle tool confirmations.
|
|
108
111
|
- `/exit`, `/quit`: exit.
|
|
@@ -119,6 +122,7 @@ Tools:
|
|
|
119
122
|
- Working notes: `Note`.
|
|
120
123
|
- Ask the user: `Question`.
|
|
121
124
|
- MCP: `MCP`.
|
|
125
|
+
- 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
126
|
|
|
123
127
|
`Read`, `Search`, and `InspectCode` return line anchors where useful. `Edit` uses current `line:hash` anchors to reject stale edits.
|
|
124
128
|
|
|
@@ -133,12 +137,14 @@ Default config location:
|
|
|
133
137
|
Main fields:
|
|
134
138
|
|
|
135
139
|
- `[provider] active = "name"`
|
|
136
|
-
- `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `timeout`
|
|
140
|
+
- `[provider.<name>]`: `url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `max_tokens`, `strict_tools`, `timeout`
|
|
137
141
|
- `[paths] data_dir`
|
|
138
|
-
- `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`
|
|
142
|
+
- `[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
143
|
|
|
140
144
|
`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
145
|
|
|
146
|
+
`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.
|
|
147
|
+
|
|
142
148
|
Runtime flags such as `--yolo`, `--debug`, and `--mcp` apply to resumed sessions too. Saved sessions do not carry their old runtime config forward.
|
|
143
149
|
|
|
144
150
|
## MCP
|
|
@@ -178,6 +184,37 @@ Manage servers at runtime:
|
|
|
178
184
|
- `/mcp refresh [server]`: rediscover servers.
|
|
179
185
|
- `/mcp login <server>` / `/mcp logout <server>`: OAuth login and logout.
|
|
180
186
|
|
|
187
|
+
## Skills
|
|
188
|
+
|
|
189
|
+
Skills are reusable instruction packs the agent can pull in on demand. Each skill is a folder with a `SKILL.md`:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
.nanocode/skills/ # project skills (travel with the repo)
|
|
193
|
+
release-notes/
|
|
194
|
+
SKILL.md
|
|
195
|
+
scripts/
|
|
196
|
+
collect_commits.py
|
|
197
|
+
~/.nanocode/skills/ # personal skills (all projects)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
`SKILL.md` has `name`/`description` frontmatter and a Markdown body of instructions:
|
|
201
|
+
|
|
202
|
+
```markdown
|
|
203
|
+
---
|
|
204
|
+
name: release-notes
|
|
205
|
+
description: Draft a CHANGELOG entry from commits since the last release.
|
|
206
|
+
---
|
|
207
|
+
Run `python "{skill_dir}/scripts/collect_commits.py" <last-tag>` to gather commits,
|
|
208
|
+
then group them by type and write entries in the house style.
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
- **Discovery**: `.nanocode/skills/` (project) and `~/.nanocode/skills/` (user). On a name clash the project skill wins.
|
|
212
|
+
- **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.
|
|
213
|
+
- **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.
|
|
214
|
+
- **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`).
|
|
215
|
+
- **Inspect**: `/skills` lists installed skills; the status bar and `/status` show the count.
|
|
216
|
+
- **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.
|
|
217
|
+
|
|
181
218
|
## Providers
|
|
182
219
|
|
|
183
220
|
The following providers have been tested with nanocode:
|
|
@@ -94,6 +94,8 @@ nanocode --resume last
|
|
|
94
94
|
|
|
95
95
|
- `/help`:显示命令和工具。
|
|
96
96
|
- `/status`:显示运行状态,包括当前 session id。
|
|
97
|
+
- `/context [PATH]`:显示模型的上下文帧——环境、记忆(goal、plan、known facts、check)和文件状态;`PATH` 显示该文件当前在上下文中的行。
|
|
98
|
+
- `/skills`:列出已安装的 skills(用 `Skill(name)` 加载,或在消息中用 `$name` 引用)。
|
|
97
99
|
- `/config`:显示当前配置。
|
|
98
100
|
- `/api [auto|chat|anthropic]`:显示或设置 provider API 格式。
|
|
99
101
|
- `/debug [on|off]`:切换模型 I/O debug trace。
|
|
@@ -103,6 +105,7 @@ nanocode --resume last
|
|
|
103
105
|
- `/provider [NAME]`:显示或设置 provider。
|
|
104
106
|
- `/model [MODEL]`:显示或设置模型。
|
|
105
107
|
- `/reason`:选择 reasoning effort。
|
|
108
|
+
- `/strict`:切换严格工具调用 schema(仅 OpenAI / DeepSeek)。
|
|
106
109
|
- `/set KEY VALUE`:设置当前 session 支持的 provider/runtime 值。
|
|
107
110
|
- `/yolo`:切换工具确认。
|
|
108
111
|
- `/exit`, `/quit`:退出。
|
|
@@ -119,6 +122,7 @@ nanocode --resume last
|
|
|
119
122
|
- 工作笔记:`Note`。
|
|
120
123
|
- 询问用户:`Question`。
|
|
121
124
|
- MCP:`MCP`。
|
|
125
|
+
- Skills:`Skill` 按需加载某个 skill 的完整说明(只要存在任一 skill 即提供——内置的 `nanocode-help` 意味着它通常始终可用)。
|
|
122
126
|
|
|
123
127
|
`Read`、`Search` 和 `InspectCode` 会在合适时返回行锚点。`Edit` 使用当前 `line:hash` 锚点拒绝过期编辑。
|
|
124
128
|
|
|
@@ -133,12 +137,14 @@ nanocode --resume last
|
|
|
133
137
|
主要字段:
|
|
134
138
|
|
|
135
139
|
- `[provider] active = "name"`
|
|
136
|
-
- `[provider.<name>]`:`url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `timeout`
|
|
140
|
+
- `[provider.<name>]`:`url`, `key`, `model`, `api`, `prompt_cache_key`, `available_models`, `reasoning`, `chat_reasoning`, `temperature`, `max_tokens`, `strict_tools`, `timeout`
|
|
137
141
|
- `[paths] data_dir`
|
|
138
|
-
- `[runtime] shell_timeout`, `max_agent_steps`, `max_context_tokens`, `check_updates`, `update_check_interval_hours`, `session_retention_days`, `yolo`, `debug`
|
|
142
|
+
- `[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
143
|
|
|
140
144
|
`api = "auto"` 会根据 provider/model profile 在 Chat Completions 和 Anthropic Messages 之间选择。`prompt_cache_key = "auto"` 会根据 provider、model、workspace 和工具 schema 名称生成稳定 key。
|
|
141
145
|
|
|
146
|
+
`strict_tools = true`(用 `/strict` 切换)会将工具调用参数约束到每个工具的 JSON schema。它仅在支持该特性的 host(OpenAI 和 DeepSeek)以及 Chat Completions 路径上生效,其他情况下为空操作。对 DeepSeek,启用后请求会路由到 `/beta` 端点。无法在严格函数调用下表示的工具 schema 会自动回退到非严格模式。
|
|
147
|
+
|
|
142
148
|
`--yolo`、`--debug` 和 `--mcp` 等 runtime flags 对恢复的 session 同样生效。保存的 session 不会携带旧 runtime config。
|
|
143
149
|
|
|
144
150
|
## MCP
|
|
@@ -178,6 +184,37 @@ HTTP 鉴权选项(`auth`、`bearer_token_env_var`、`env_http_headers`)只
|
|
|
178
184
|
- `/mcp refresh [server]`:重新发现服务器。
|
|
179
185
|
- `/mcp login <server>` / `/mcp logout <server>`:OAuth 登录和登出。
|
|
180
186
|
|
|
187
|
+
## Skills
|
|
188
|
+
|
|
189
|
+
Skills 是可复用的指令包,agent 可按需加载。每个 skill 是一个包含 `SKILL.md` 的文件夹:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
.nanocode/skills/ # 项目 skills(随仓库一起提交)
|
|
193
|
+
release-notes/
|
|
194
|
+
SKILL.md
|
|
195
|
+
scripts/
|
|
196
|
+
collect_commits.py
|
|
197
|
+
~/.nanocode/skills/ # 个人 skills(对所有项目生效)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
`SKILL.md` 带有 `name`/`description` 前置元数据,正文是 Markdown 指令:
|
|
201
|
+
|
|
202
|
+
```markdown
|
|
203
|
+
---
|
|
204
|
+
name: release-notes
|
|
205
|
+
description: Draft a CHANGELOG entry from commits since the last release.
|
|
206
|
+
---
|
|
207
|
+
运行 `python "{skill_dir}/scripts/collect_commits.py" <last-tag>` 收集提交,
|
|
208
|
+
再按类型分组并以项目既有风格撰写条目。
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
- **发现路径**:`.nanocode/skills/`(项目)和 `~/.nanocode/skills/`(用户)。同名时项目 skill 优先。
|
|
212
|
+
- **模型如何看到**:上下文中只放一个精简的 `SKILLS` 索引(name + description);完整正文仅在模型调用 `Skill(name)` 时按需加载。对同一 skill 的重复加载会折叠为一行指针,避免重复计费。未安装任何 skill 时不会向 prompt 添加内容。
|
|
213
|
+
- **内联引用**:在消息中输入 `$name`(支持 Tab 补全)以提示模型使用该 skill;其指令会为该轮注入。
|
|
214
|
+
- **随附脚本**:正文中的 `{skill_dir}`(或 `${SKILL_DIR}`)会展开为该 skill 的绝对目录路径,模型可通过 `Bash` 运行随附脚本(除非 `/yolo`,否则仍需正常确认)。
|
|
215
|
+
- **查看**:`/skills` 列出已安装的 skills;状态栏和 `/status` 会显示数量。
|
|
216
|
+
- **内置**:默认自带 `nanocode-help` skill,其正文是一份自包含手册——包含关于如何使用 nanocode、其功能和常见问题的成文说明,外加由 nanocode 自身的 `/help` 文本、工具描述和配置项在加载时拼装而成的命令/工具/配置清单。因此“怎么用 / X 是什么 / 为什么 Y”这类问题可直接从手册回答,无需检索源码,且清单不会与运行版本脱节。放置同名 `nanocode-help` skill 即可覆盖它。
|
|
217
|
+
|
|
181
218
|
## Providers
|
|
182
219
|
|
|
183
220
|
以下 provider 已在 nanocode 中测试通过:
|