min-agent 0.4.0 → 0.4.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 +145 -290
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,366 +1,221 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# min-agent
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
一款在终端里运行的 AI 编程助手 · An AI coding agent that lives in your terminal
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
[](#english)
|
|
8
|
+
[](#简体中文)
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
npm install -g min-agent
|
|
9
|
-
min-agent update # Upgrade to the latest npm release
|
|
10
|
-
```
|
|
10
|
+
</div>
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
<br>
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
min-agent setup # Configure provider
|
|
16
|
-
min-agent # Interactive session
|
|
17
|
-
min-agent "hello" # Interactive session, send immediately
|
|
18
|
-
min-agent exec "hello" # One-shot, then exit
|
|
19
|
-
min-agent exec --resume <id> "continue" # Continue a saved one-shot session
|
|
20
|
-
```
|
|
14
|
+
<div align="center">
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
⬇️ 请选择你的语言 / Please choose your language ⬇️
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
**➡️ [English](#english) ➡️ [简体中文](#简体中文)**
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
min-agent # Interactive session
|
|
28
|
-
min-agent "msg" # Interactive session, send immediately
|
|
29
|
-
min-agent exec "msg" # One-shot, then exit
|
|
30
|
-
min-agent exec --resume <id> "msg" # Continue a saved one-shot session
|
|
31
|
-
min-agent -m <model> "msg" # Override model
|
|
32
|
-
min-agent --provider <name> "msg" # Use a specific provider
|
|
33
|
-
min-agent -i img.png "msg" # Attach image
|
|
34
|
-
min-agent --resume <id> # Resume session
|
|
35
|
-
min-agent chat | code # Same as interactive session (compat)
|
|
36
|
-
min-agent setup # Configure API provider
|
|
37
|
-
min-agent models # List available models
|
|
38
|
-
min-agent history # List saved sessions
|
|
39
|
-
min-agent history delete <id> # Delete a session
|
|
40
|
-
min-agent history rename <id> <t> # Rename a session
|
|
41
|
-
min-agent history export <id> [-o file] # Export a session as JSON
|
|
42
|
-
min-agent update # Upgrade to the latest npm release
|
|
43
|
-
min-agent rules # Show loaded rules
|
|
44
|
-
min-agent rules edit # Edit global rules
|
|
45
|
-
min-agent memory # List project + global memories
|
|
46
|
-
min-agent memory add "text" # Save memory (project if .min-agent exists)
|
|
47
|
-
min-agent memory add "text" --project
|
|
48
|
-
min-agent memory add "text" --global
|
|
49
|
-
min-agent mcp -h # MCP server management
|
|
50
|
-
min-agent skills -h # Skills management
|
|
51
|
-
min-agent sandbox # Show isolation
|
|
52
|
-
min-agent sandbox off # Write isolation to config and exit
|
|
53
|
-
min-agent --sandbox workspace "msg" # This session only; does not write config
|
|
54
|
-
min-agent sandbox network deny --project
|
|
55
|
-
min-agent permission # Show confirmation mode
|
|
56
|
-
min-agent --permission ask # Write confirmation mode to config and exit
|
|
57
|
-
min-agent --permission accept-edits --project
|
|
58
|
-
min-agent --permission allow-all "msg" # This session only
|
|
59
|
-
min-agent serve # Start HTTP API server
|
|
60
|
-
```
|
|
20
|
+
</div>
|
|
61
21
|
|
|
62
|
-
|
|
22
|
+
<br><br>
|
|
63
23
|
|
|
64
|
-
|
|
24
|
+
<a id="english"></a>
|
|
65
25
|
|
|
66
|
-
|
|
67
|
-
|---------|-------------|
|
|
68
|
-
| `/new` | Start a new session (keeps the current one) |
|
|
69
|
-
| `/compact` | Force compaction |
|
|
70
|
-
| `/model [name]` | Interactive model picker (↑↓ navigate, Enter confirm) |
|
|
71
|
-
| `/provider [name]` | List/switch provider |
|
|
72
|
-
| `/plan` | Toggle read-only plan mode |
|
|
73
|
-
| `/memory [text]` | List/save memory (`--project` writes to this repo) |
|
|
74
|
-
| `/tokens` | Context occupancy, session totals & cost |
|
|
75
|
-
| `/budget [n]` | Show/set cost budget (USD; `--project` writes to this repo) |
|
|
76
|
-
| `/permission` | Show/set confirmation (`ask` / `accept-edits` / `allow-all`; `--project` writes to this repo) |
|
|
77
|
-
| `/sandbox` | Show/set isolation (`off` / `workspace` / `strict`; `--project` writes to this repo) |
|
|
78
|
-
| `/undo` | Undo last turn |
|
|
79
|
-
| `/redo` | Resend last message |
|
|
80
|
-
| `/diff` | Show working tree diff |
|
|
81
|
-
| `/sessions [id]` | List or switch saved sessions |
|
|
82
|
-
| `/resume [id]` | Same as `/sessions` |
|
|
83
|
-
| `/reload` | Reload rules |
|
|
84
|
-
| `/rename <title>` | Rename current session |
|
|
85
|
-
| `/attach <path>` | Attach a local image |
|
|
86
|
-
| `/paste [text]` | Clipboard image |
|
|
87
|
-
| `/mcp` | MCP server status |
|
|
88
|
-
| `/skills` | List skills; `/skills info <name>` to view; `/skills enable\|disable <name>` to toggle |
|
|
89
|
-
| `/models` | List available models |
|
|
90
|
-
| `/path` | Working directory |
|
|
91
|
-
| `/help` | All commands |
|
|
92
|
-
| `/exit` | Exit |
|
|
26
|
+
# 🇬🇧 English
|
|
93
27
|
|
|
94
|
-
|
|
28
|
+
> A minimal AI coding agent for your terminal. Works with OpenAI, Ollama, and any OpenAI-compatible provider.
|
|
95
29
|
|
|
96
|
-
|
|
30
|
+
<sub>[🔝 Back to language selector](#min-agent) · [🇨🇳 Switch to 简体中文](#简体中文)</sub>
|
|
97
31
|
|
|
98
|
-
|
|
32
|
+
## Get Started
|
|
99
33
|
|
|
100
|
-
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g min-agent
|
|
36
|
+
min-agent setup # Configure your AI provider
|
|
37
|
+
min-agent # Start chatting
|
|
38
|
+
```
|
|
101
39
|
|
|
102
|
-
##
|
|
40
|
+
## Basic Usage
|
|
103
41
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"type": "openai-compatible",
|
|
113
|
-
"baseURL": "https://api.openai.com/v1",
|
|
114
|
-
"apiKey": "sk-...",
|
|
115
|
-
"defaultModel": "gpt-5.5",
|
|
116
|
-
"contextWindow": 1000000
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"activeProvider": "default",
|
|
120
|
-
"webSearchURL": "https://your-searxng.example.com",
|
|
121
|
-
"serperApiKey": "your-serper-key",
|
|
122
|
-
"instructions": ["./docs/rules.md"],
|
|
123
|
-
"disabledSkills": [],
|
|
124
|
-
"pricing": { "gpt-5.5": { "inputPerMillion": 1.25, "outputPerMillion": 10 } },
|
|
125
|
-
"sampling": { "temperature": 0.7, "maxTokens": 4096 },
|
|
126
|
-
"budget": { "maxCostUSD": 5 }
|
|
127
|
-
}
|
|
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
|
|
128
50
|
```
|
|
129
51
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"enabledSkills": ["skill-disabled-globally"],
|
|
137
|
-
"activeProvider": "default",
|
|
138
|
-
"defaultModel": "gpt-5.5",
|
|
139
|
-
"sampling": { "temperature": 0.4 },
|
|
140
|
-
"budget": { "maxCostUSD": 2 },
|
|
141
|
-
"permission": "ask",
|
|
142
|
-
"sandbox": { "mode": "workspace", "network": "allow" },
|
|
143
|
-
"compaction": { "autoContinue": false }
|
|
144
|
-
}
|
|
52
|
+
Attach an image or pick a specific model/provider for one message:
|
|
53
|
+
|
|
54
|
+
```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"
|
|
145
58
|
```
|
|
146
59
|
|
|
147
|
-
|
|
60
|
+
## While Chatting
|
|
148
61
|
|
|
149
|
-
|
|
62
|
+
Type `/` to open a command menu. Use **↑ / ↓** to recall previous messages.
|
|
150
63
|
|
|
151
|
-
|
|
64
|
+
| Command | Description |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `/new` | Start a new session |
|
|
67
|
+
| `/model` | Switch model |
|
|
68
|
+
| `/provider` | Switch provider |
|
|
69
|
+
| `/plan` | Toggle plan mode (look, don't touch) |
|
|
70
|
+
| `/undo` | Undo the last turn |
|
|
71
|
+
| `/diff` | Show file changes made so far |
|
|
72
|
+
| `/sessions` | List or switch sessions |
|
|
73
|
+
| `/attach <path>` | Attach a local image |
|
|
74
|
+
| `/mcp` | Show connected MCP servers |
|
|
75
|
+
| `/skills` | Manage skills |
|
|
76
|
+
| `/tokens` | Usage and estimated cost |
|
|
77
|
+
| `/help` | Show all commands |
|
|
78
|
+
| `/exit` | Exit |
|
|
152
79
|
|
|
153
|
-
|
|
154
|
-
min-agent permission # show current confirmation mode
|
|
155
|
-
min-agent --permission ask # write global config, then exit
|
|
156
|
-
min-agent --permission accept-edits --project
|
|
157
|
-
min-agent --permission allow-all "msg" # this session only; does not write config
|
|
158
|
-
```
|
|
80
|
+
Shortcuts: **Ctrl+C** clears the input (press twice to exit) · **Ctrl+B** selects text to copy · mouse drag-select also copies on release.
|
|
159
81
|
|
|
160
|
-
|
|
82
|
+
## Staying in Control
|
|
161
83
|
|
|
162
|
-
|
|
84
|
+
min-agent asks for confirmation before risky actions by default.
|
|
163
85
|
|
|
164
86
|
```bash
|
|
165
|
-
min-agent
|
|
166
|
-
min-agent --
|
|
167
|
-
min-agent --
|
|
168
|
-
min-agent --
|
|
169
|
-
min-agent sandbox network deny
|
|
87
|
+
min-agent permission # Show current setting
|
|
88
|
+
min-agent --permission ask # Confirm before risky actions (default)
|
|
89
|
+
min-agent --permission accept-edits # Auto-approve file edits only
|
|
90
|
+
min-agent --permission allow-all # Auto-approve everything — use with care
|
|
170
91
|
```
|
|
171
92
|
|
|
172
|
-
|
|
173
|
-
"sandbox": {
|
|
174
|
-
"mode": "workspace",
|
|
175
|
-
"network": "allow",
|
|
176
|
-
"extraWriteRoots": ["/path/allowed-to-write"],
|
|
177
|
-
"extraReadRoots": []
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
`mode`: `off` (default) | `workspace` (write only in the working directory, plus temp/cache) | `strict` (read and write only there). `extraWriteRoots` / `extraReadRoots` add extra directories when isolation is on. Env: `MIN_AGENT_SANDBOX`, `MIN_AGENT_SANDBOX_NETWORK`.
|
|
93
|
+
You can also limit what it's allowed to touch on your machine:
|
|
182
94
|
|
|
183
|
-
|
|
95
|
+
```bash
|
|
96
|
+
min-agent sandbox # Show current restriction level
|
|
97
|
+
min-agent sandbox off # No restriction (default)
|
|
98
|
+
min-agent sandbox workspace # Only allow changes inside the current folder
|
|
99
|
+
```
|
|
184
100
|
|
|
185
|
-
|
|
101
|
+
## Configuration
|
|
186
102
|
|
|
187
|
-
|
|
103
|
+
Run `min-agent setup` for a guided setup — this is the easiest way to add or switch AI providers.
|
|
188
104
|
|
|
189
|
-
`
|
|
105
|
+
Settings live in `~/.min-agent/config.json` (global). A project can have its own `.min-agent/config.json` that only applies there.
|
|
190
106
|
|
|
191
|
-
|
|
107
|
+
## Extending It
|
|
192
108
|
|
|
193
|
-
|
|
109
|
+
- **MCP servers** — connect external tools and data sources: `min-agent mcp -h`
|
|
110
|
+
- **Skills** — reusable instructions the agent loads automatically: `min-agent skills -h`
|
|
111
|
+
- **Project rules** — add an `AGENTS.md` or `RULES.md` file to your project for custom instructions; use `~/.min-agent/rules.md` for global ones.
|
|
194
112
|
|
|
195
|
-
|
|
113
|
+
## API Access
|
|
196
114
|
|
|
197
|
-
|
|
115
|
+
`min-agent serve` starts a local HTTP API server so other apps can talk to min-agent. Reference: [docs/API.md](docs/API.md)
|
|
198
116
|
|
|
199
|
-
|
|
117
|
+
## License
|
|
200
118
|
|
|
201
|
-
|
|
119
|
+
MIT
|
|
202
120
|
|
|
203
|
-
|
|
121
|
+
<br>
|
|
204
122
|
|
|
205
123
|
---
|
|
206
124
|
|
|
207
|
-
|
|
125
|
+
<br>
|
|
208
126
|
|
|
209
|
-
|
|
210
|
-
min-agent mcp add <name> <cmd...> # Local stdio
|
|
211
|
-
min-agent mcp add <name> <cmd...> --env K=V # Local stdio with env vars
|
|
212
|
-
min-agent mcp add <name> --url <url> --token T # Remote HTTP
|
|
213
|
-
min-agent mcp add <name> --url <url> --sse # Legacy SSE transport
|
|
214
|
-
min-agent mcp add <name> --url <url> --streamable-http # Force streamable HTTP
|
|
215
|
-
min-agent mcp add <name> ... --project # Save to .min-agent/mcp.json (this repo only)
|
|
216
|
-
min-agent mcp add <name> ... --timeout 10000 # Connection/call timeout in ms
|
|
217
|
-
min-agent mcp list # List (name + status + scope)
|
|
218
|
-
min-agent mcp info <name> # Details
|
|
219
|
-
min-agent mcp enable/disable <name...> [--project] # Toggle
|
|
220
|
-
min-agent mcp remove <name> [--project] # Remove
|
|
221
|
-
min-agent mcp check # Test connectivity
|
|
222
|
-
```
|
|
127
|
+
<a id="简体中文"></a>
|
|
223
128
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Connected servers expose resources and prompts to the agent via `mcp_list_resources` / `mcp_read_resource` / `mcp_list_prompts` / `mcp_get_prompt`. `/mcp` shows counts when a server advertises them.
|
|
227
|
-
|
|
228
|
-
远程服务器如需 OAuth 登录(部分云端 MCP),在 mcp.json 里加 `"oauth": {}`(或用 `"clientId"`/`"clientSecret"`/`"scope"` 显式指定),连接时自动打开浏览器完成授权,令牌缓存在 `~/.min-agent/mcp-oauth/`。`"oauth": false` 关闭。
|
|
229
|
-
|
|
230
|
-
mcp.json 完整字段(`min-agent mcp add` 只生成子集,其余手写):
|
|
231
|
-
|
|
232
|
-
```json
|
|
233
|
-
{
|
|
234
|
-
"mcpServers": {
|
|
235
|
-
"filesystem": {
|
|
236
|
-
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
|
|
237
|
-
"environment": { "KEY": "VALUE" },
|
|
238
|
-
"enabled": true,
|
|
239
|
-
"connectTimeout": 10000,
|
|
240
|
-
"callTimeout": 30000
|
|
241
|
-
},
|
|
242
|
-
"remote": {
|
|
243
|
-
"url": "https://mcp.example.com/mcp",
|
|
244
|
-
"remoteTransport": "auto",
|
|
245
|
-
"token": "bearer-token",
|
|
246
|
-
"headers": { "X-API-Key": "..." },
|
|
247
|
-
"oauth": {},
|
|
248
|
-
"connectTimeout": 15000,
|
|
249
|
-
"callTimeout": 30000
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
```
|
|
129
|
+
# 🇨🇳 简体中文
|
|
254
130
|
|
|
255
|
-
|
|
256
|
-
- `timeout`:连接与调用共用的旧字段;`connectTimeout` / `callTimeout` 可分别覆盖
|
|
257
|
-
- 连接失败时错误信息会带上服务器 stderr 的最后几行,便于排查
|
|
131
|
+
> 一款可在终端里运行的极简 AI 编程助手,支持 OpenAI、Ollama 以及任何兼容 OpenAI 接口的服务商。
|
|
258
132
|
|
|
259
|
-
|
|
133
|
+
<sub>[🔝 返回语言选择](#min-agent) · [🇬🇧 Switch to English](#english)</sub>
|
|
134
|
+
|
|
135
|
+
## 快速上手
|
|
260
136
|
|
|
261
137
|
```bash
|
|
262
|
-
min-agent
|
|
263
|
-
min-agent
|
|
264
|
-
min-agent
|
|
265
|
-
min-agent skills info <name> --json # Details as JSON
|
|
266
|
-
min-agent skills new <name> # Create a skill scaffold (.min-agent/skills/<name>/)
|
|
267
|
-
min-agent skills new <name> --global # Create in ~/.agents/skills/<name>/
|
|
268
|
-
min-agent skills disable <name...> # Disable everywhere (global)
|
|
269
|
-
min-agent skills disable <name...> --project # Disable in this repo only
|
|
270
|
-
min-agent skills enable <name...> --project # Re-enable here even if disabled globally
|
|
138
|
+
npm install -g min-agent
|
|
139
|
+
min-agent setup # 配置你的 AI 服务商
|
|
140
|
+
min-agent # 开始对话
|
|
271
141
|
```
|
|
272
142
|
|
|
273
|
-
|
|
274
|
-
Project wins over global, so disabling a repo-local skill never affects other repos.
|
|
143
|
+
## 基本用法
|
|
275
144
|
|
|
276
|
-
|
|
277
|
-
|
|
145
|
+
```bash
|
|
146
|
+
min-agent # 进入交互会话
|
|
147
|
+
min-agent "你的消息" # 进入交互会话并立即发送消息
|
|
148
|
+
min-agent exec "你的消息" # 单次提问后自动退出
|
|
149
|
+
min-agent --resume <id> # 恢复之前的会话
|
|
150
|
+
min-agent history # 查看已保存的会话
|
|
151
|
+
min-agent models # 查看可用模型
|
|
152
|
+
min-agent update # 升级到最新版本
|
|
153
|
+
```
|
|
278
154
|
|
|
279
|
-
|
|
155
|
+
为单条消息附带图片,或指定模型/服务商:
|
|
280
156
|
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
# optional
|
|
286
|
-
version: 1.0.0
|
|
287
|
-
allowed-tools: [read, grep]
|
|
288
|
-
metadata:
|
|
289
|
-
requires:
|
|
290
|
-
bins: ["some-cli"]
|
|
291
|
-
---
|
|
292
|
-
# Instructions...
|
|
157
|
+
```bash
|
|
158
|
+
min-agent -i photo.png "这张图片是什么?"
|
|
159
|
+
min-agent -m gpt-5.5 "你的消息"
|
|
160
|
+
min-agent --provider anthropic "你的消息"
|
|
293
161
|
```
|
|
294
162
|
|
|
295
|
-
|
|
296
|
-
- Discovery paths, in override order: `~/.agents/skills/` → `.min-agent/skills/` → `.agents/skills/` → `.opencode/skills/` → `.claude/skills/`. Symlinked skill directories are followed, so one shared skill library can be linked into several of these.
|
|
297
|
-
- A same-named skill in a later user path overrides the earlier one; within one path the top-level `SKILL.md` wins over a nested copy.
|
|
298
|
-
- Built-in skills shipped with min-agent (including `self-config`, which the agent loads automatically when changing its own settings) are always discovered and win on name over user copies.
|
|
299
|
-
- `MIN_AGENT_SKILLS_DIRS` (path-delimiter separated) replaces the user discovery list; built-in skills still load unless `MIN_AGENT_NO_BUILTIN_SKILLS=1`.
|
|
300
|
-
- Files next to `SKILL.md` (including subdirectories such as `scripts/`) are listed for the agent when the skill loads; `metadata.requires.bins` entries missing from `PATH` are reported.
|
|
163
|
+
## 对话中的操作
|
|
301
164
|
|
|
302
|
-
|
|
165
|
+
输入 `/` 弹出命令菜单。使用 **↑ / ↓** 翻看之前的消息。
|
|
303
166
|
|
|
304
|
-
|
|
|
305
|
-
|
|
306
|
-
|
|
|
307
|
-
|
|
|
308
|
-
| `
|
|
167
|
+
| 命令 | 说明 |
|
|
168
|
+
|---|---|
|
|
169
|
+
| `/new` | 开始新会话 |
|
|
170
|
+
| `/model` | 切换模型 |
|
|
171
|
+
| `/provider` | 切换服务商 |
|
|
172
|
+
| `/plan` | 切换"计划模式"(只看不改) |
|
|
173
|
+
| `/undo` | 撤销上一轮操作 |
|
|
174
|
+
| `/diff` | 查看当前已产生的文件改动 |
|
|
175
|
+
| `/sessions` | 查看或切换会话 |
|
|
176
|
+
| `/attach <路径>` | 附加本地图片 |
|
|
177
|
+
| `/mcp` | 查看已连接的 MCP 服务 |
|
|
178
|
+
| `/skills` | 管理技能 |
|
|
179
|
+
| `/tokens` | 查看用量与预估费用 |
|
|
180
|
+
| `/help` | 查看全部命令 |
|
|
181
|
+
| `/exit` | 退出 |
|
|
309
182
|
|
|
310
|
-
|
|
183
|
+
快捷键:**Ctrl+C** 清空输入框(连按两次退出)· **Ctrl+B** 选中文本以复制 · 也支持鼠标拖拽选中并自动复制。
|
|
311
184
|
|
|
312
|
-
|
|
185
|
+
## 掌控风险
|
|
313
186
|
|
|
314
|
-
|
|
187
|
+
min-agent 默认会在执行有风险的操作前先询问你。
|
|
315
188
|
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
189
|
+
```bash
|
|
190
|
+
min-agent permission # 查看当前设置
|
|
191
|
+
min-agent --permission ask # 有风险操作前先询问(默认)
|
|
192
|
+
min-agent --permission accept-edits # 仅自动批准文件修改
|
|
193
|
+
min-agent --permission allow-all # 自动批准所有操作 —— 请谨慎使用
|
|
322
194
|
```
|
|
323
195
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const { execSync } = await import("child_process")
|
|
331
|
-
return execSync(`docker ps --format "table {{.Names}}\t{{.Status}}" --limit ${limit ?? 10}`, {
|
|
332
|
-
encoding: "utf-8",
|
|
333
|
-
})
|
|
334
|
-
}
|
|
335
|
-
}
|
|
196
|
+
也可以限制它能在你电脑上访问的范围:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
min-agent sandbox # 查看当前限制级别
|
|
200
|
+
min-agent sandbox off # 不限制(默认)
|
|
201
|
+
min-agent sandbox workspace # 仅允许修改当前项目文件夹内的内容
|
|
336
202
|
```
|
|
337
203
|
|
|
338
|
-
|
|
204
|
+
## 配置
|
|
339
205
|
|
|
340
|
-
|
|
206
|
+
运行 `min-agent setup` 即可通过引导式流程完成配置,这是添加或切换 AI 服务商最简单的方式。
|
|
341
207
|
|
|
342
|
-
|
|
343
|
-
min-agent serve [--port 8787]
|
|
344
|
-
```
|
|
208
|
+
配置保存在 `~/.min-agent/config.json`(全局生效)。也可以在某个项目下单独创建 `.min-agent/config.json`,仅对该项目生效。
|
|
345
209
|
|
|
346
|
-
|
|
210
|
+
## 扩展能力
|
|
347
211
|
|
|
348
|
-
|
|
212
|
+
- **MCP 服务**:连接外部工具与数据源,运行 `min-agent mcp -h` 了解详情
|
|
213
|
+
- **技能(Skills)**:可自动加载的可复用指令集,运行 `min-agent skills -h` 了解详情
|
|
214
|
+
- **项目规则**:在项目根目录添加 `AGENTS.md` 或 `RULES.md` 编写自定义指令;全局规则写入 `~/.min-agent/rules.md`
|
|
215
|
+
|
|
216
|
+
## API 接入
|
|
349
217
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
| Variable | Description |
|
|
353
|
-
|----------|-------------|
|
|
354
|
-
| `EXA_API_KEY` | Enable Exa code search |
|
|
355
|
-
| `MIN_AGENT_SERPER_API_KEY` | Optional Serper key override for `search_web` (takes precedence over `serperApiKey` in config; a built-in default is used otherwise) |
|
|
356
|
-
| `MIN_AGENT_SEARXNG_URL` | Use SearXNG instead of Serper for `search_web` (takes precedence over `webSearchURL` in config) |
|
|
357
|
-
| `MIN_AGENT_SEARXNG_FALLBACK_ENGINES` | Engines retried when the SearXNG instance's default engines return nothing (default `google,bing`; empty string disables the retry) |
|
|
358
|
-
| `MIN_AGENT_FIRECRAWL_URL` | Firecrawl instance for `web_fetch` (takes precedence over `webFetchURL` in config) |
|
|
359
|
-
| `MIN_AGENT_SKILLS_DIRS` | `:`-separated dirs that replace the user skill discovery list (built-in skills still load) |
|
|
360
|
-
| `MIN_AGENT_NO_BUILTIN_SKILLS` | `1` to skip skills shipped with min-agent |
|
|
361
|
-
| `MIN_AGENT_SHOW_THINKING` | `0` to hide thinking |
|
|
362
|
-
| `MIN_AGENT_SERVE_TOKEN` | API auth token |
|
|
363
|
-
| `MIN_AGENT_SERVE_CORS` | `1` to enable CORS (without a token, only localhost origins are allowed) |
|
|
218
|
+
`min-agent serve` 可启动本地 HTTP API 服务,供其他应用调用。完整说明见 [docs/API.md](docs/API.md)
|
|
364
219
|
|
|
365
220
|
## License
|
|
366
221
|
|