min-agent 0.6.1 → 0.6.3
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 +77 -125
- package/dist/cli.js +217 -217
- package/docs/API.md +3 -1
- package/package.json +2 -2
- package/skills/self-config/SKILL.md +2 -2
- package/skills/self-config/reference.md +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
一款在终端里运行的 AI 编程助手 · An AI coding agent that lives in your terminal
|
|
6
6
|
|
|
7
|
+
**🌐 [https://min-agent.lonae.com](https://min-agent.lonae.com)**
|
|
8
|
+
|
|
7
9
|
[](#english)
|
|
8
10
|
[](#简体中文)
|
|
9
11
|
|
|
@@ -33,108 +35,83 @@
|
|
|
33
35
|
|
|
34
36
|
```bash
|
|
35
37
|
npm install -g min-agent
|
|
36
|
-
min-agent #
|
|
37
|
-
min-agent
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Basic Usage
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
min-agent # Start an interactive session
|
|
44
|
-
min-agent "your message" # Start a session and send a message immediately
|
|
45
|
-
min-agent exec "your message" # Ask a single question, then exit
|
|
46
|
-
min-agent --resume <id> # Resume a previous session
|
|
47
|
-
min-agent history # List saved sessions
|
|
48
|
-
min-agent models # List available models
|
|
49
|
-
min-agent update # Upgrade to the latest version
|
|
38
|
+
min-agent # start chatting (built-in OpenRouter model, preset & locked)
|
|
39
|
+
min-agent models # list models (always openrouter/free)
|
|
50
40
|
```
|
|
51
41
|
|
|
52
|
-
|
|
42
|
+
## Usage
|
|
53
43
|
|
|
54
44
|
```bash
|
|
55
|
-
min-agent
|
|
56
|
-
min-agent
|
|
57
|
-
min-agent --
|
|
45
|
+
min-agent "your message" # start a session and send a message
|
|
46
|
+
min-agent exec "your message" # one-shot question, then exit
|
|
47
|
+
min-agent --resume <id> # resume a previous session
|
|
48
|
+
min-agent history # list saved sessions
|
|
49
|
+
min-agent -i photo.png "..." # attach an image
|
|
50
|
+
min-agent -m gpt-5.5 "..." # pick a model for one message
|
|
51
|
+
min-agent --provider anthropic "..." # pick a provider for one message
|
|
58
52
|
```
|
|
59
53
|
|
|
60
54
|
## While Chatting
|
|
61
55
|
|
|
62
|
-
Type `/` to open
|
|
56
|
+
Type `/` to open the command menu; **↑/↓** selects. On an empty input, **↑/↓** recalls past messages.
|
|
63
57
|
|
|
64
|
-
| Command |
|
|
58
|
+
| Command | What it does |
|
|
65
59
|
|---|---|
|
|
66
|
-
| `/new`
|
|
67
|
-
| `/model` | Switch model |
|
|
68
|
-
| `/
|
|
69
|
-
| `/
|
|
70
|
-
| `/
|
|
71
|
-
| `/
|
|
72
|
-
| `/
|
|
73
|
-
| `/
|
|
74
|
-
| `/sessions` | List or switch sessions |
|
|
75
|
-
| `/attach <path>` | Attach a local image |
|
|
76
|
-
| `/mcp` | Show connected MCP servers |
|
|
77
|
-
| `/skills` | Manage skills |
|
|
78
|
-
| `/tokens` | Usage and estimated cost |
|
|
79
|
-
| `/ctx` | Choose local-model context window |
|
|
80
|
-
| `/help` | Show all commands |
|
|
81
|
-
| `/exit` | Exit |
|
|
82
|
-
|
|
83
|
-
Shortcuts: **Ctrl+C** clears the input (press twice to exit) · **Ctrl+V** pastes an image · a multi-line paste becomes a snippet · **Ctrl+B** selects text to copy · mouse drag-select also copies on release · click a tool or thinking block to expand or collapse it · when it asks you to choose, use **↑/↓** and **Enter** (Space checks items in multi-select).
|
|
60
|
+
| `/new` · `/sessions` | New session · switch between sessions |
|
|
61
|
+
| `/model` · `/provider` | Switch model / provider |
|
|
62
|
+
| `/plan` | Plan mode — look, don't touch |
|
|
63
|
+
| `/think` · `/ctx` | Thinking intensity · local-model context window |
|
|
64
|
+
| `/memory` | Toggle memory or save a note |
|
|
65
|
+
| `/undo` · `/diff` | Undo last turn · show changes so far |
|
|
66
|
+
| `/attach` · `/mcp` · `/skills` | Attach an image · MCP servers · skills |
|
|
67
|
+
| `/tokens` · `/help` | Usage & cost · all commands |
|
|
84
68
|
|
|
85
|
-
|
|
69
|
+
Shortcuts: **Ctrl+C** clears input (press twice to exit) · **Ctrl+V** pastes an image · **Ctrl+B** copies selected text · click a tool or thinking block to expand it.
|
|
86
70
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
min-agent permission # Show current setting
|
|
91
|
-
min-agent --permission ask # Confirm before risky actions
|
|
92
|
-
min-agent --permission accept-edits # Auto-approve file edits only (default)
|
|
93
|
-
min-agent --permission allow-all # Auto-approve everything — use with care
|
|
94
|
-
```
|
|
71
|
+
## Staying in Control
|
|
95
72
|
|
|
96
|
-
|
|
73
|
+
File edits are auto-approved by default; risky actions always ask.
|
|
97
74
|
|
|
98
75
|
```bash
|
|
99
|
-
min-agent
|
|
100
|
-
min-agent
|
|
101
|
-
min-agent
|
|
76
|
+
min-agent permission # show current setting
|
|
77
|
+
min-agent --permission ask # confirm before risky actions
|
|
78
|
+
min-agent --permission accept-edits # auto-approve file edits (default)
|
|
79
|
+
min-agent --permission allow-all # auto-approve everything — use with care
|
|
80
|
+
min-agent sandbox workspace # only allow changes inside this folder
|
|
102
81
|
```
|
|
103
82
|
|
|
104
83
|
## Memory
|
|
105
84
|
|
|
106
|
-
|
|
85
|
+
Off by default. Turn it on to keep facts across sessions:
|
|
107
86
|
|
|
108
87
|
```bash
|
|
109
|
-
min-agent memory
|
|
110
|
-
min-agent memory on # Turn memory on (writes config)
|
|
111
|
-
min-agent --memory on # Same; with a message, this session only
|
|
88
|
+
min-agent memory on # enable (writes config)
|
|
112
89
|
min-agent memory add "prefer bun"
|
|
113
90
|
```
|
|
114
91
|
|
|
115
|
-
In chat
|
|
92
|
+
In chat: `/memory on|off` toggles, `/memory` lists notes, `/memory some text` saves one.
|
|
116
93
|
|
|
117
94
|
## Configuration
|
|
118
95
|
|
|
119
|
-
|
|
96
|
+
No setup needed — the built-in OpenRouter provider (`openrouter/free`) is preset and locked:
|
|
120
97
|
|
|
121
98
|
```bash
|
|
122
|
-
min-agent
|
|
123
|
-
min-agent setup --type openai-compatible --url https://api.example.com/v1 --api-key "$KEY" --name groq --default-model llama-3.1-70b
|
|
124
|
-
min-agent setup --switch ollama
|
|
99
|
+
min-agent models # always lists exactly: openrouter/free
|
|
125
100
|
```
|
|
126
101
|
|
|
127
|
-
|
|
102
|
+
The preset provider cannot be modified and `min-agent setup` refuses to add, edit, switch, or remove providers while it is active; the model is fixed to `openrouter/free` (no model list is fetched). Set `MIN_AGENT_NO_BUILTIN_PROVIDER=1` to disable the preset before configuring your own provider.
|
|
103
|
+
|
|
104
|
+
Settings live in `~/.min-agent/config.json` (global). For per-project settings, run `min-agent init` to create `.min-agent/config.json`.
|
|
128
105
|
|
|
129
106
|
## Extending It
|
|
130
107
|
|
|
131
|
-
- **MCP servers** — connect external tools
|
|
132
|
-
- **Skills** — reusable instructions
|
|
133
|
-
- **Project rules** — add
|
|
108
|
+
- **MCP servers** — connect external tools: `min-agent mcp -h`
|
|
109
|
+
- **Skills** — reusable instructions loaded automatically: `min-agent skills -h`
|
|
110
|
+
- **Project rules** — add `AGENTS.md` or `RULES.md` to your project; global rules go in `~/.min-agent/rules.md`
|
|
134
111
|
|
|
135
112
|
## API Access
|
|
136
113
|
|
|
137
|
-
`min-agent serve` starts a local HTTP API
|
|
114
|
+
`min-agent serve` starts a local HTTP API for other apps to talk to. Reference: [docs/API.md](docs/API.md)
|
|
138
115
|
|
|
139
116
|
## License
|
|
140
117
|
|
|
@@ -158,104 +135,79 @@ MIT
|
|
|
158
135
|
|
|
159
136
|
```bash
|
|
160
137
|
npm install -g min-agent
|
|
161
|
-
min-agent #
|
|
162
|
-
min-agent
|
|
138
|
+
min-agent # 开始对话(内置 OpenRouter 模型,已预设并锁定)
|
|
139
|
+
min-agent models # 查看模型(始终为 openrouter/free)
|
|
163
140
|
```
|
|
164
141
|
|
|
165
142
|
## 基本用法
|
|
166
143
|
|
|
167
144
|
```bash
|
|
168
|
-
min-agent
|
|
169
|
-
min-agent "你的消息"
|
|
170
|
-
min-agent
|
|
171
|
-
min-agent
|
|
172
|
-
min-agent
|
|
173
|
-
min-agent
|
|
174
|
-
min-agent
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
为单条消息附带图片,或指定模型/服务商:
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
min-agent -i photo.png "这张图片是什么?"
|
|
181
|
-
min-agent -m gpt-5.5 "你的消息"
|
|
182
|
-
min-agent --provider anthropic "你的消息"
|
|
145
|
+
min-agent "你的消息" # 进入交互会话并立即发送消息
|
|
146
|
+
min-agent exec "你的消息" # 单次提问后自动退出
|
|
147
|
+
min-agent --resume <id> # 恢复之前的会话
|
|
148
|
+
min-agent history # 查看已保存的会话
|
|
149
|
+
min-agent -i photo.png "..." # 为一条消息附带图片
|
|
150
|
+
min-agent -m gpt-5.5 "..." # 为一条消息指定模型
|
|
151
|
+
min-agent --provider anthropic "..." # 为一条消息指定服务商
|
|
183
152
|
```
|
|
184
153
|
|
|
185
154
|
## 对话中的操作
|
|
186
155
|
|
|
187
|
-
输入 `/` 弹出命令菜单,用
|
|
156
|
+
输入 `/` 弹出命令菜单,用 **↑/↓** 移动高亮;输入框为空时,**↑/↓** 翻看之前消息。
|
|
188
157
|
|
|
189
|
-
| 命令 |
|
|
158
|
+
| 命令 | 作用 |
|
|
190
159
|
|---|---|
|
|
191
|
-
| `/new` |
|
|
192
|
-
| `/model` | 切换模型 |
|
|
193
|
-
| `/
|
|
194
|
-
| `/
|
|
195
|
-
| `/think` | 选择思考强度 |
|
|
160
|
+
| `/new` · `/sessions` | 新建会话 · 切换会话 |
|
|
161
|
+
| `/model` · `/provider` | 切换模型 / 服务商 |
|
|
162
|
+
| `/plan` | 计划模式——只看不改 |
|
|
163
|
+
| `/think` · `/ctx` | 思考强度 · 本地模型上下文窗口 |
|
|
196
164
|
| `/memory` | 开关记忆,或保存一条 |
|
|
197
|
-
| `/undo` |
|
|
198
|
-
| `/
|
|
199
|
-
| `/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
| `/skills` | 管理技能 |
|
|
203
|
-
| `/tokens` | 查看用量与预估费用 |
|
|
204
|
-
| `/ctx` | 选择本地模型上下文窗口 |
|
|
205
|
-
| `/help` | 查看全部命令 |
|
|
206
|
-
| `/exit` | 退出 |
|
|
207
|
-
|
|
208
|
-
快捷键:**Ctrl+C** 清空输入框(连按两次退出)· **Ctrl+V** 粘贴图片 · 多行粘贴会收成片段 · **Ctrl+B** 选中文本以复制 · 也支持鼠标拖拽选中并自动复制 · 点击工具或思考块可展开或收起 · 需要你做选择时用 **↑/↓** 移动、**Enter** 确认(多选时用空格勾选)。
|
|
165
|
+
| `/undo` · `/diff` | 撤销上一轮 · 查看已产生的改动 |
|
|
166
|
+
| `/attach` · `/mcp` · `/skills` | 附加图片 · MCP 服务 · 技能 |
|
|
167
|
+
| `/tokens` · `/help` | 用量与费用 · 全部命令 |
|
|
168
|
+
|
|
169
|
+
快捷键:**Ctrl+C** 清空输入(连按两次退出)· **Ctrl+V** 粘贴图片 · **Ctrl+B** 复制选中的文本 · 点击工具或思考块可展开收起。
|
|
209
170
|
|
|
210
171
|
## 掌控风险
|
|
211
172
|
|
|
212
|
-
|
|
173
|
+
文件修改默认自动批准,危险操作仍会询问:
|
|
213
174
|
|
|
214
175
|
```bash
|
|
215
176
|
min-agent permission # 查看当前设置
|
|
216
177
|
min-agent --permission ask # 有风险操作前先询问
|
|
217
178
|
min-agent --permission accept-edits # 仅自动批准文件修改(默认)
|
|
218
|
-
min-agent --permission allow-all #
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
也可以限制它能在你电脑上访问的范围:
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
min-agent sandbox # 查看当前限制级别
|
|
225
|
-
min-agent sandbox off # 不限制(默认)
|
|
226
|
-
min-agent sandbox workspace # 仅允许修改当前项目文件夹内的内容
|
|
179
|
+
min-agent --permission allow-all # 自动批准所有操作——请谨慎使用
|
|
180
|
+
min-agent sandbox workspace # 仅允许修改当前文件夹内内容
|
|
227
181
|
```
|
|
228
182
|
|
|
229
183
|
## 记忆
|
|
230
184
|
|
|
231
|
-
|
|
185
|
+
默认关闭。想让偏好跨会话保留时再打开:
|
|
232
186
|
|
|
233
187
|
```bash
|
|
234
|
-
min-agent memory
|
|
235
|
-
min-agent memory on # 开启记忆(写入配置)
|
|
236
|
-
min-agent --memory on # 同上;若同时带消息则只对本轮生效
|
|
188
|
+
min-agent memory on # 开启记忆(写入配置)
|
|
237
189
|
min-agent memory add "prefer bun"
|
|
238
190
|
```
|
|
239
191
|
|
|
240
|
-
对话里用 `/memory on
|
|
192
|
+
对话里用 `/memory on|off` 开关,`/memory` 查看,`/memory 一段话` 保存一条。
|
|
241
193
|
|
|
242
194
|
## 配置
|
|
243
195
|
|
|
244
|
-
|
|
196
|
+
无需配置即可使用——内置 OpenRouter 服务商(`openrouter/free`)已预设并锁定:
|
|
245
197
|
|
|
246
198
|
```bash
|
|
247
|
-
min-agent
|
|
248
|
-
min-agent setup --type openai-compatible --url https://api.example.com/v1 --api-key "$KEY" --name groq --default-model llama-3.1-70b
|
|
249
|
-
min-agent setup --switch ollama
|
|
199
|
+
min-agent models # 始终只列出: openrouter/free
|
|
250
200
|
```
|
|
251
201
|
|
|
252
|
-
|
|
202
|
+
预设服务商不可修改:在其生效期间 `min-agent setup` 会拒绝添加、修改、切换或删除服务商,模型固定为 `openrouter/free`(不拉取模型列表)。设置 `MIN_AGENT_NO_BUILTIN_PROVIDER=1` 关闭预设后,才能配置自己的服务商。
|
|
203
|
+
|
|
204
|
+
配置保存在 `~/.min-agent/config.json`(全局生效)。项目级配置用 `min-agent init` 创建 `.min-agent/config.json`,仅对该项目生效。
|
|
253
205
|
|
|
254
206
|
## 扩展能力
|
|
255
207
|
|
|
256
|
-
- **MCP
|
|
257
|
-
- **技能(Skills
|
|
258
|
-
-
|
|
208
|
+
- **MCP 服务**:连接外部工具与数据源,`min-agent mcp -h`
|
|
209
|
+
- **技能(Skills)**:可自动加载的可复用指令集,`min-agent skills -h`
|
|
210
|
+
- **项目规则**:在项目里添加 `AGENTS.md` 或 `RULES.md`;全局规则写入 `~/.min-agent/rules.md`
|
|
259
211
|
|
|
260
212
|
## API 接入
|
|
261
213
|
|
|
@@ -263,4 +215,4 @@ min-agent setup --switch ollama
|
|
|
263
215
|
|
|
264
216
|
## License
|
|
265
217
|
|
|
266
|
-
MIT
|
|
218
|
+
MIT
|