@hncode/hncode 0.1.0 → 0.1.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.
- package/README.md +340 -330
- package/package.json +9 -1
- package/TODO.md +0 -72
package/README.md
CHANGED
|
@@ -1,330 +1,340 @@
|
|
|
1
|
-
# hncode — AI Coding Agent CLI
|
|
2
|
-
|
|
3
|
-
> **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
|
|
4
|
-
|
|
5
|
-
A cyan-blue TUI coding agent inspired by kimi-code-cli, with OpenAI + Anthropic support, MCP-style toolbelt, and intelligent context management.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 🌟 Features
|
|
10
|
-
|
|
11
|
-
- **Cyan-blue TUI**: Raw terminal renderer for perfect Windows Terminal compatibility
|
|
12
|
-
- **Dual Protocol Support**: Works with both OpenAI-compatible APIs and Anthropic
|
|
13
|
-
- **Smart Context Management**: Auto-compaction at 85% usage, AI-summarized history retention
|
|
14
|
-
- **MCP-style Toolbelt**: Read, Write, Edit, Bash, Glob, Grep, TodoList, WebSearch, etc.
|
|
15
|
-
- **Plugin System**: Extend with custom tools, commands, and hooks
|
|
16
|
-
- **Session Persistence**: Resume conversations across sessions
|
|
17
|
-
- **Permission Modes**: Ask, YOLO, or Auto modes for different workflows
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 🚀 Installation
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
1
|
+
# hncode — AI Coding Agent CLI
|
|
2
|
+
|
|
3
|
+
> **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
|
|
4
|
+
|
|
5
|
+
A cyan-blue TUI coding agent inspired by kimi-code-cli, with OpenAI + Anthropic support, MCP-style toolbelt, and intelligent context management.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🌟 Features
|
|
10
|
+
|
|
11
|
+
- **Cyan-blue TUI**: Raw terminal renderer for perfect Windows Terminal compatibility
|
|
12
|
+
- **Dual Protocol Support**: Works with both OpenAI-compatible APIs and Anthropic
|
|
13
|
+
- **Smart Context Management**: Auto-compaction at 85% usage, AI-summarized history retention
|
|
14
|
+
- **MCP-style Toolbelt**: Read, Write, Edit, Bash, Glob, Grep, TodoList, WebSearch, etc.
|
|
15
|
+
- **Plugin System**: Extend with custom tools, commands, and hooks
|
|
16
|
+
- **Session Persistence**: Resume conversations across sessions
|
|
17
|
+
- **Permission Modes**: Ask, YOLO, or Auto modes for different workflows
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🚀 Installation
|
|
22
|
+
|
|
23
|
+
### Global Installation (Recommended)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @hncode/hncode
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then run:
|
|
30
|
+
```bash
|
|
31
|
+
hncode
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Using npx (No installation required)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @hncode/hncode
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This will download and run the latest version without installing it globally.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## ⚙️ Configuration
|
|
45
|
+
|
|
46
|
+
Create `~/.hncode/config.toml`:
|
|
47
|
+
|
|
48
|
+
```toml
|
|
49
|
+
default_model = "gpt-4o-mini"
|
|
50
|
+
|
|
51
|
+
[providers.openai]
|
|
52
|
+
base_url = "https://api.openai.com/v1"
|
|
53
|
+
api_key = "your-api-key-here"
|
|
54
|
+
|
|
55
|
+
[models.gpt-4o-mini]
|
|
56
|
+
provider = "openai"
|
|
57
|
+
model = "gpt-4o-mini"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Or set environment variables:
|
|
61
|
+
```bash
|
|
62
|
+
export HNCODE_API_KEY="your-key"
|
|
63
|
+
export HNCODE_PROVIDER="openai"
|
|
64
|
+
export HNCODE_MODEL="gpt-4o-mini"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 📖 Usage
|
|
70
|
+
|
|
71
|
+
### Basic Commands
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Start interactive session
|
|
75
|
+
hncode
|
|
76
|
+
|
|
77
|
+
# Headless mode (one prompt)
|
|
78
|
+
hncode -p "Fix the bug in src/main.js"
|
|
79
|
+
|
|
80
|
+
# Continue previous session
|
|
81
|
+
hncode --continue
|
|
82
|
+
|
|
83
|
+
# Auto mode (no questions)
|
|
84
|
+
hncode --auto
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Slash Commands
|
|
88
|
+
|
|
89
|
+
| Command | Description |
|
|
90
|
+
|---------|-------------|
|
|
91
|
+
| `/compact [ratio]` | Compact conversation (AI summary + keep last 20%) |
|
|
92
|
+
| `/model <name>` | Switch LLM model |
|
|
93
|
+
| `/sessions` | Browse and resume past conversations |
|
|
94
|
+
| `/move <path>` | Move current session to another directory |
|
|
95
|
+
| `/auto` / `/ask` / `/yolo` | Toggle permission mode |
|
|
96
|
+
| `/plan` / `/focus` | Toggle research-only or full-edit mode |
|
|
97
|
+
| `/calm-mode` | Terse replies (skip narration) |
|
|
98
|
+
| `/help` | Show all commands |
|
|
99
|
+
|
|
100
|
+
### Advanced Features
|
|
101
|
+
|
|
102
|
+
**Tab Completion**:
|
|
103
|
+
- Type `/` → command menu
|
|
104
|
+
- Type `@` → file/folder completion
|
|
105
|
+
- Use Tab to navigate and Enter to select
|
|
106
|
+
|
|
107
|
+
**Auto Compaction**:
|
|
108
|
+
- Triggers at 85% context window
|
|
109
|
+
- AI summarizes dropped messages
|
|
110
|
+
- Keeps most recent 20% of conversation
|
|
111
|
+
|
|
112
|
+
**Plugin System**:
|
|
113
|
+
Place plugins in `~/.hncode/plugins/`:
|
|
114
|
+
```javascript
|
|
115
|
+
// my-plugin.mjs
|
|
116
|
+
export function install(api) {
|
|
117
|
+
api.registerTool({ /* ... */ });
|
|
118
|
+
api.registerCommand({ name: 'mycmd', run: () => {} });
|
|
119
|
+
}
|
|
120
|
+
export default { name: 'my-plugin', version: '1.0.0' };
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 🛠 Tools
|
|
126
|
+
|
|
127
|
+
Built-in tools include:
|
|
128
|
+
- `Read`, `Write`, `Edit` - File operations
|
|
129
|
+
- `Bash` - Execute shell commands
|
|
130
|
+
- `Glob`, `Grep` - Search files
|
|
131
|
+
- `TodoList`, `TaskOutput` - Task management
|
|
132
|
+
- `FetchURL`, `WebSearch` - Internet access
|
|
133
|
+
- `ReadMediaFile`, `FileLines` - Media handling
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 🎨 Theme
|
|
138
|
+
|
|
139
|
+
Supported themes: `auto`, `dark`, `light`, or custom RGB colors.
|
|
140
|
+
|
|
141
|
+
Set via config:
|
|
142
|
+
```toml
|
|
143
|
+
theme = "dark"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Or `/theme <name>` in TUI.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 🤝 Contributing
|
|
151
|
+
|
|
152
|
+
This project was created through Vibe Coding. While it may not be perfect, I welcome your feedback!
|
|
153
|
+
|
|
154
|
+
**Please feel free to:**
|
|
155
|
+
- Submit issues for bugs or suggestions
|
|
156
|
+
- Fork and create pull requests
|
|
157
|
+
- Share your experience using hncode
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 🙏 Acknowledgments
|
|
162
|
+
|
|
163
|
+
hncode draws inspiration from several excellent projects:
|
|
164
|
+
|
|
165
|
+
- **[kimi-code-cli](https://github.com/mckaymatt/kimi-code-cli)** - The original cyan-blue TUI coding agent that inspired this project's design and approach
|
|
166
|
+
- **[claude-code](https://github.com/anthropics/claude-code)** - The conversation flow and tool interaction patterns
|
|
167
|
+
|
|
168
|
+
Special thanks to the communities behind these projects for pushing the boundaries of AI-assisted coding.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 📄 License
|
|
173
|
+
|
|
174
|
+
MIT License - See LICENSE file for details.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
# hncode — AI 编程助手命令行工具
|
|
179
|
+
|
|
180
|
+
> **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
|
|
181
|
+
|
|
182
|
+
一个青色蓝调终端界面的 AI 编程助手,灵感来自 kimi-code-cli,支持 OpenAI 和 Anthropic API,配备 MCP 风格的工具集和智能上下文管理。
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 🌟 功能特性
|
|
187
|
+
|
|
188
|
+
- **青色蓝调 TUI**: 原生终端渲染器,完美兼容 Windows Terminal
|
|
189
|
+
- **双协议支持**: 同时支持 OpenAI 兼容 API 和 Anthropic
|
|
190
|
+
- **智能上下文管理**: 85% 使用率时自动压缩,AI 摘要保留历史对话
|
|
191
|
+
- **MCP 风格工具集**: Read、Write、Edit、Bash、Glob、Grep、TodoList、WebSearch 等
|
|
192
|
+
- **插件系统**: 通过自定义工具、命令和钩子扩展功能
|
|
193
|
+
- **会话持久化**: 跨会话恢复对话
|
|
194
|
+
- **权限模式**: Ask、YOLO、Auto 三种工作流模式
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 🚀 安装
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npm install -g hncode
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
或直接使用:
|
|
205
|
+
```bash
|
|
206
|
+
npx hncode
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## ⚙️ 配置
|
|
212
|
+
|
|
213
|
+
创建 `~/.hncode/config.toml`:
|
|
214
|
+
|
|
215
|
+
```toml
|
|
216
|
+
default_model = "gpt-4o-mini"
|
|
217
|
+
|
|
218
|
+
[providers.openai]
|
|
219
|
+
base_url = "https://api.openai.com/v1"
|
|
220
|
+
api_key = "你的-api-key"
|
|
221
|
+
|
|
222
|
+
[models.gpt-4o-mini]
|
|
223
|
+
provider = "openai"
|
|
224
|
+
model = "gpt-4o-mini"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
或使用环境变量:
|
|
228
|
+
```bash
|
|
229
|
+
export HNCODE_API_KEY="你的-key"
|
|
230
|
+
export HNCODE_PROVIDER="openai"
|
|
231
|
+
export HNCODE_MODEL="gpt-4o-mini"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 📖 使用方法
|
|
237
|
+
|
|
238
|
+
### 基本命令
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# 启动交互式会话
|
|
242
|
+
hncode
|
|
243
|
+
|
|
244
|
+
# 无头模式(单次提示)
|
|
245
|
+
hncode -p "修复 src/main.js 中的 bug"
|
|
246
|
+
|
|
247
|
+
# 继续之前的会话
|
|
248
|
+
hncode --continue
|
|
249
|
+
|
|
250
|
+
# 自动模式(不问问题)
|
|
251
|
+
hncode --auto
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### 斜杠命令
|
|
255
|
+
|
|
256
|
+
| 命令 | 描述 |
|
|
257
|
+
|------|------|
|
|
258
|
+
| `/compact [ratio]` | 压缩对话(AI 摘要 + 保留最近 20%) |
|
|
259
|
+
| `/model <name>` | 切换 LLM 模型 |
|
|
260
|
+
| `/sessions` | 浏览和恢复过往对话 |
|
|
261
|
+
| `/move <path>` | 将当前会话迁移到另一个目录 |
|
|
262
|
+
| `/auto` / `/ask` / `/yolo` | 切换权限模式 |
|
|
263
|
+
| `/plan` / `/focus` | 切换仅研究或完整编辑模式 |
|
|
264
|
+
| `/calm-mode` | 简洁回复(跳过叙述) |
|
|
265
|
+
| `/help` | 显示所有命令 |
|
|
266
|
+
|
|
267
|
+
### 高级功能
|
|
268
|
+
|
|
269
|
+
**Tab 补全**:
|
|
270
|
+
- 输入 `/` → 命令菜单
|
|
271
|
+
- 输入 `@` → 文件/文件夹补全
|
|
272
|
+
- 使用 Tab 导航,Enter 选择
|
|
273
|
+
|
|
274
|
+
**自动压缩**:
|
|
275
|
+
- 在 85% 上下文窗口时触发
|
|
276
|
+
- AI 摘要被丢弃的消息
|
|
277
|
+
- 保留最近 20% 的对话
|
|
278
|
+
|
|
279
|
+
**插件系统**:
|
|
280
|
+
将插件放在 `~/.hncode/plugins/`:
|
|
281
|
+
```javascript
|
|
282
|
+
// my-plugin.mjs
|
|
283
|
+
export function install(api) {
|
|
284
|
+
api.registerTool({ /* ... */ });
|
|
285
|
+
api.registerCommand({ name: 'mycmd', run: () => {} });
|
|
286
|
+
}
|
|
287
|
+
export default { name: 'my-plugin', version: '1.0.0' };
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 🛠 内置工具
|
|
293
|
+
|
|
294
|
+
- `Read`, `Write`, `Edit` - 文件操作
|
|
295
|
+
- `Bash` - 执行 Shell 命令
|
|
296
|
+
- `Glob`, `Grep` - 搜索文件
|
|
297
|
+
- `TodoList`, `TaskOutput` - 任务管理
|
|
298
|
+
- `FetchURL`, `WebSearch` - 网络访问
|
|
299
|
+
- `ReadMediaFile`, `FileLines` - 媒体处理
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 🎨 主题
|
|
304
|
+
|
|
305
|
+
支持的 theme:`auto`、`dark`、`light` 或自定义 RGB 颜色。
|
|
306
|
+
|
|
307
|
+
通过配置设置:
|
|
308
|
+
```toml
|
|
309
|
+
theme = "dark"
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
或在 TUI 中使用 `/theme <name>`。
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## 🤝 贡献
|
|
317
|
+
|
|
318
|
+
这个项目是通过 Vibe Coding 创建的。虽然它可能不够完美,但我欢迎您的反馈!
|
|
319
|
+
|
|
320
|
+
**欢迎:**
|
|
321
|
+
- 提交问题报告 bug 或提出建议
|
|
322
|
+
- Fork 并创建拉取请求
|
|
323
|
+
- 分享您使用 hncode 的体验
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## 🙏 致谢
|
|
328
|
+
|
|
329
|
+
hncode 从以下几个优秀项目中汲取了灵感:
|
|
330
|
+
|
|
331
|
+
- **[kimi-code-cli](https://github.com/mckaymatt/kimi-code-cli)** - 原始的青色蓝调终端界面 AI 编程助手,启发了本项目的设计和理念
|
|
332
|
+
- **[claude-code](https://github.com/anthropics/claude-code)** - 对话流程和工具交互模式
|
|
333
|
+
|
|
334
|
+
特别感谢这些项目背后的社区,它们推动了 AI 辅助编程的边界。
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 📄 许可证
|
|
339
|
+
|
|
340
|
+
MIT License - 详见 LICENSE 文件。
|
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hncode/hncode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "hncode — A cyan-blue TUI AI coding agent with zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "src/index.js",
|
|
6
7
|
"bin": {
|
|
7
8
|
"hncode": "bin/hncode"
|
|
8
9
|
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"src/",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md",
|
|
15
|
+
"package.json"
|
|
16
|
+
],
|
|
9
17
|
"scripts": {
|
|
10
18
|
"preinstall": "node bin/preinstall.js",
|
|
11
19
|
"install": "node bin/install.js"
|
package/TODO.md
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# hncode TODO
|
|
2
|
-
|
|
3
|
-
## Fixed
|
|
4
|
-
|
|
5
|
-
- [x] **Fix `args is not defined` in `/compact` command** — `src/tui.js:2508`
|
|
6
|
-
The `compact` case referenced an undefined variable `args`. Removed the
|
|
7
|
-
redundant `const raw = args.trim();` line; the function's existing
|
|
8
|
-
`const raw = (arg || '').trim();` (line ~2142) is used instead.
|
|
9
|
-
|
|
10
|
-
- [x] **Fix `/model` picker overflow above screen** — `src/tui.js:~1617-1620`
|
|
11
|
-
The picker's `overhead` calculation did not account for footer rows (the
|
|
12
|
-
"Thinking" options in the `/model` picker). Now includes `footerRows`
|
|
13
|
-
(0 or 2) in the overhead. Also added `MAX_PICKER = 12` constant to cap
|
|
14
|
-
visible items.
|
|
15
|
-
|
|
16
|
-
- [x] **Add `MAX_PICKER = 12` constant** — `src/tui.js:111`
|
|
17
|
-
Caps the number of visible picker items at 12, similar to `MAX_MENU = 6`.
|
|
18
|
-
|
|
19
|
-
- [x] **Reduce right-side width by 1 for queue panel and user message boxes**
|
|
20
|
-
- Queue panel text width: `w - 4` → `w - 6` (`src/tui.js:711`)
|
|
21
|
-
- User/queued message box width: `boxW = innerW` → `boxW = innerW - 2`
|
|
22
|
-
(`src/tui.js:1213`)
|
|
23
|
-
|
|
24
|
-
- [x] **Fix steer format: render as `steer` role (no box)** — `src/tui.js:3774`
|
|
25
|
-
Steered messages were added as `user` role (with a box). Changed to
|
|
26
|
-
`addChat({ role: 'steer', text })`. The `steer` role has no box, is
|
|
27
|
-
yellow, and shows the `❯` marker.
|
|
28
|
-
|
|
29
|
-
- [x] **Rename `/cool-mode` to `/calm-mode`** — `src/tui.js, src/config.js`
|
|
30
|
-
- Command: `cool-mode` → `calm-mode`
|
|
31
|
-
- Config key: `cool_mode` → `calm_mode`
|
|
32
|
-
- Config property: `coolMode` → `calmMode`
|
|
33
|
-
- Env var: `HNCODE_COOL_MODE` → `HNCODE_CALM_MODE`
|
|
34
|
-
- Constant: `COOL_MODE_INSTRUCTION` → `CALM_MODE_INSTRUCTION`
|
|
35
|
-
- Backward compat: legacy `cool_mode` key still read in config.js
|
|
36
|
-
|
|
37
|
-
- [x] **Fix `setConfigString is not defined` error** — `src/tui.js:27`
|
|
38
|
-
`setConfigString` was used but never imported from `./config.js`.
|
|
39
|
-
Added to the import statement.
|
|
40
|
-
|
|
41
|
-
- [x] **Fix editor ESC/arrow keys when running** — `src/tui.js:~3957`
|
|
42
|
-
When the editor (from `/set-system-prompt`) is open and a turn is running,
|
|
43
|
-
ESC interrupted the agent instead of closing the editor. Fixed by adding
|
|
44
|
-
`state.editor` to the `overlayOpen` check.
|
|
45
|
-
|
|
46
|
-
- [x] **Fix scroll jumping to session beginning** — `src/tui.js:~4772`
|
|
47
|
-
`anchorScroll()` used `state._anchorRows || 0` as the previous row count,
|
|
48
|
-
which caused a massive scroll jump on the first call after scrolling up.
|
|
49
|
-
Changed to only adjust scroll when `_anchorRows` is previously set.
|
|
50
|
-
|
|
51
|
-
- [x] **Add category tabs to `/model` picker** — `src/tui.js`
|
|
52
|
-
- Added `pickerCategory` and `pickerCategories` state fields
|
|
53
|
-
- `pickerFiltered()` now filters by active category
|
|
54
|
-
- Category tabs rendered above the item list ("All" + provider names)
|
|
55
|
-
- Tab key cycles through categories
|
|
56
|
-
- `/model` picker items now have a `category` field (the provider name)
|
|
57
|
-
- Hint updated to mention Tab for category switching
|
|
58
|
-
|
|
59
|
-
- [x] **Composer text selection via mouse drag** — `src/tui.js`
|
|
60
|
-
- Added `composerSel` state for selection range
|
|
61
|
-
- Mousedown on composer rows stores position for drag selection
|
|
62
|
-
- Mousemove extends the selection (highlighted in yellow)
|
|
63
|
-
- Mouseup clears the mousedown state
|
|
64
|
-
- Context menu includes "Copy" for composer selection
|
|
65
|
-
- Ctrl+Shift+C copies composer selection (before falling back to last answer)
|
|
66
|
-
- All key handlers (typing, arrows, backspace, etc.) clear the selection
|
|
67
|
-
- Added `highlightSelection()` helper function
|
|
68
|
-
|
|
69
|
-
- [x] **Fix `/provider` Enter to edit, remove Ctrl+E** — `src/tui.js`
|
|
70
|
-
- Enter on a regular provider now opens the edit form (was: selects provider)
|
|
71
|
-
- Ctrl+E handler removed from the generic key handler
|
|
72
|
-
- Hint updated: "Enter edit" instead of "Enter select · Ctrl+E edit"
|