min-agent 0.6.0 → 0.6.2

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 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](https://img.shields.io/badge/lang-English-blue.svg)](#english)
8
10
  [![简体中文](https://img.shields.io/badge/lang-简体中文-red.svg)](#简体中文)
9
11
 
@@ -33,90 +35,65 @@
33
35
 
34
36
  ```bash
35
37
  npm install -g min-agent
36
- min-agent # Start chatting (a built-in model is ready)
37
- min-agent setup # Optional: add or switch your own AI provider
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 (a built-in model is ready)
39
+ min-agent setup # optional: add or switch your own provider
50
40
  ```
51
41
 
52
- Attach an image or pick a specific model/provider for one message:
42
+ ## Usage
53
43
 
54
44
  ```bash
55
- min-agent -i photo.png "what's in this image?"
56
- min-agent -m gpt-5.5 "your message"
57
- min-agent --provider anthropic "your message"
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 a command menu; **↑ / ↓** moves the highlight. With an empty input, **↑ / ↓** recalls previous messages.
56
+ Type `/` to open the command menu; **↑/↓** selects. On an empty input, **↑/↓** recalls past messages.
63
57
 
64
- | Command | Description |
58
+ | Command | What it does |
65
59
  |---|---|
66
- | `/new` | Start a new session |
67
- | `/model` | Switch model |
68
- | `/provider` | Switch provider (interactive picker) |
69
- | `/plan` | Toggle plan mode (look, don't touch) |
70
- | `/think` | Choose thinking intensity |
71
- | `/memory` | Turn memory on/off, or save a note |
72
- | `/undo` | Undo the last turn |
73
- | `/diff` | Show file changes made so far |
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
- ## Staying in Control
86
-
87
- min-agent asks for confirmation before risky actions by default. File edits are auto-approved unless you change this.
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.
88
70
 
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
- You can also limit what it's allowed to touch on your machine:
73
+ File edits are auto-approved by default; risky actions always ask.
97
74
 
98
75
  ```bash
99
- min-agent sandbox # Show current restriction level
100
- min-agent sandbox off # No restriction (default)
101
- min-agent sandbox workspace # Only allow changes inside the current folder
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
- Remembered notes are off by default. Turn them on when you want facts to persist across sessions:
85
+ Off by default. Turn it on to keep facts across sessions:
107
86
 
108
87
  ```bash
109
- min-agent memory # Show the switch and stored notes
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, `/memory on` or `/memory off` toggles it; `/memory` lists notes; `/memory some text` saves one.
92
+ In chat: `/memory on|off` toggles, `/memory` lists notes, `/memory some text` saves one.
116
93
 
117
94
  ## Configuration
118
95
 
119
- Run `min-agent setup` to add or switch AI providers. If you skip it, min-agent uses a built-in OpenRouter model (`openrouter/free`). Your own providers in `~/.min-agent/config.json` always take over.
96
+ No setup needed a built-in OpenRouter model (`openrouter/free`) is used until you add your own:
120
97
 
121
98
  ```bash
122
99
  min-agent setup --type ollama
@@ -124,17 +101,17 @@ min-agent setup --type openai-compatible --url https://api.example.com/v1 --api-
124
101
  min-agent setup --switch ollama
125
102
  ```
126
103
 
127
- Settings live in `~/.min-agent/config.json` (global). A project can have its own `.min-agent/config.json` that only applies there.
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 and data sources: `min-agent mcp -h`
132
- - **Skills** — reusable instructions the agent loads automatically: `min-agent skills -h`
133
- - **Project rules** — add an `AGENTS.md` or `RULES.md` file to your project for custom instructions; use `~/.min-agent/rules.md` for global ones.
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 server so other apps can talk to min-agent. Reference: [docs/API.md](docs/API.md)
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
 
@@ -159,89 +136,64 @@ MIT
159
136
  ```bash
160
137
  npm install -g min-agent
161
138
  min-agent # 开始对话(已内置可用模型)
162
- min-agent setup # 可选:添加或切换你自己的 AI 服务商
139
+ min-agent setup # 可选:添加或切换你自己的服务商
163
140
  ```
164
141
 
165
142
  ## 基本用法
166
143
 
167
144
  ```bash
168
- min-agent # 进入交互会话
169
- min-agent "你的消息" # 进入交互会话并立即发送消息
170
- min-agent exec "你的消息" # 单次提问后自动退出
171
- min-agent --resume <id> # 恢复之前的会话
172
- min-agent history # 查看已保存的会话
173
- min-agent models # 查看可用模型
174
- min-agent update # 升级到最新版本
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
- | `/provider` | 交互式切换服务商 |
194
- | `/plan` | 切换"计划模式"(只看不改) |
195
- | `/think` | 选择思考强度 |
160
+ | `/new` · `/sessions` | 新建会话 · 切换会话 |
161
+ | `/model` · `/provider` | 切换模型 / 服务商 |
162
+ | `/plan` | 计划模式——只看不改 |
163
+ | `/think` · `/ctx` | 思考强度 · 本地模型上下文窗口 |
196
164
  | `/memory` | 开关记忆,或保存一条 |
197
- | `/undo` | 撤销上一轮操作 |
198
- | `/diff` | 查看当前已产生的文件改动 |
199
- | `/sessions` | 查看或切换会话 |
200
- | `/attach <路径>` | 附加本地图片 |
201
- | `/mcp` | 查看已连接的 MCP 服务 |
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
- min-agent 默认自动批准文件修改,危险命令仍会询问。可按需调整:
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` 或 `/memory off` 开关;`/memory` 查看;`/memory 一段话` 保存一条。
192
+ 对话里用 `/memory on|off` 开关,`/memory` 查看,`/memory 一段话` 保存一条。
241
193
 
242
194
  ## 配置
243
195
 
244
- 未配置服务商时,min-agent 会使用内置的 OpenRouter 模型(`openrouter/free`)。运行 `min-agent setup` 可添加或切换你自己的服务商;写在 `~/.min-agent/config.json` 里的配置优先于内置预设。
196
+ 无需配置即可使用——在添加自己的服务商前,内置的 OpenRouter 模型(`openrouter/free`)会一直可用:
245
197
 
246
198
  ```bash
247
199
  min-agent setup --type ollama
@@ -249,13 +201,13 @@ min-agent setup --type openai-compatible --url https://api.example.com/v1 --api-
249
201
  min-agent setup --switch ollama
250
202
  ```
251
203
 
252
- 配置保存在 `~/.min-agent/config.json`(全局生效)。也可以在某个项目下单独创建 `.min-agent/config.json`,仅对该项目生效。
204
+ 配置保存在 `~/.min-agent/config.json`(全局生效)。项目级配置用 `min-agent init` 创建 `.min-agent/config.json`,仅对该项目生效。
253
205
 
254
206
  ## 扩展能力
255
207
 
256
- - **MCP 服务**:连接外部工具与数据源,运行 `min-agent mcp -h` 了解详情
257
- - **技能(Skills)**:可自动加载的可复用指令集,运行 `min-agent skills -h` 了解详情
258
- - **项目规则**:在项目根目录添加 `AGENTS.md` 或 `RULES.md` 编写自定义指令;全局规则写入 `~/.min-agent/rules.md`
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