min-agent 0.4.0 → 0.5.0
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 +169 -284
- package/dist/agent.js +36 -22
- package/dist/cli/commands/chat.js +3 -0
- package/dist/cli/commands/exec.js +3 -0
- package/dist/cli/commands/index.js +22 -5
- package/dist/cli/commands/memory.js +33 -15
- package/dist/cli/commands/think.js +12 -0
- package/dist/cli/commands/write-config.js +22 -0
- package/dist/cli/option-helpers.js +13 -1
- package/dist/cli/program.js +50 -13
- package/dist/code-mode.js +1 -1
- package/dist/config.js +41 -0
- package/dist/context-window.js +8 -28
- package/dist/memory-cli.js +33 -0
- package/dist/memory.js +127 -46
- package/dist/model-catalog.js +285 -0
- package/dist/permission-cli.js +1 -4
- package/dist/provider.js +4 -1
- package/dist/reasoning-stream.js +158 -0
- package/dist/sandbox-cli.js +1 -4
- package/dist/scope.js +23 -0
- package/dist/serve/common.js +22 -1
- package/dist/serve/routes-chat.js +21 -1
- package/dist/serve/routes-memory.js +31 -2
- package/dist/serve/routes-meta.js +34 -6
- package/dist/think-cli.js +36 -0
- package/dist/thinking-wire.js +228 -0
- package/dist/thinking.js +142 -0
- package/dist/token-display.js +10 -7
- package/dist/tools/todo.js +22 -8
- package/dist/tui/App.js +36 -8
- package/dist/tui/InputBar.js +109 -36
- package/dist/tui/MessageList.js +53 -22
- package/dist/tui/StatusBar.js +7 -3
- package/dist/tui/ThinkPicker.js +77 -0
- package/dist/tui/bracketed-paste.js +37 -0
- package/dist/tui/caret-pos.js +10 -8
- package/dist/tui/index.js +7 -1
- package/dist/tui/layout.js +17 -0
- package/dist/tui/overlay-input.js +12 -0
- package/dist/tui/paste-draft.js +173 -0
- package/dist/tui/selection.js +8 -2
- package/dist/tui/slash-commands.js +18 -1
- package/dist/tui/slash-handler.js +61 -17
- package/dist/tui/text-width.js +6 -6
- package/dist/tui-chat.js +63 -7
- package/docs/API.md +50 -4
- package/docs/superpowers/plans/2026-08-23-input-paste-attachments.md +475 -0
- package/docs/superpowers/plans/2026-08-23-thinking-wire-profile.md +450 -0
- package/docs/superpowers/specs/2026-08-23-input-paste-attachments-design.md +174 -0
- package/docs/superpowers/specs/2026-08-23-thinking-wire-profile-design.md +140 -0
- package/package.json +1 -1
- package/skills/self-config/SKILL.md +5 -4
- package/skills/self-config/reference.md +10 -5
package/README.md
CHANGED
|
@@ -1,366 +1,251 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# min-agent
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
一款在终端里运行的 AI 编程助手 · An AI coding agent that lives in your terminal
|
|
6
|
+
|
|
7
|
+
[](#english)
|
|
8
|
+
[](#简体中文)
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<br>
|
|
13
|
+
|
|
14
|
+
<div align="center">
|
|
15
|
+
|
|
16
|
+
⬇️ 请选择你的语言 / Please choose your language ⬇️
|
|
17
|
+
|
|
18
|
+
**➡️ [English](#english) ➡️ [简体中文](#简体中文)**
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<br><br>
|
|
23
|
+
|
|
24
|
+
<a id="english"></a>
|
|
25
|
+
|
|
26
|
+
# 🇬🇧 English
|
|
27
|
+
|
|
28
|
+
> A minimal AI coding agent for your terminal. Works with OpenAI, Ollama, and any OpenAI-compatible provider.
|
|
29
|
+
|
|
30
|
+
<sub>[🔝 Back to language selector](#min-agent) · [🇨🇳 Switch to 简体中文](#简体中文)</sub>
|
|
4
31
|
|
|
5
|
-
##
|
|
32
|
+
## Get Started
|
|
6
33
|
|
|
7
34
|
```bash
|
|
8
35
|
npm install -g min-agent
|
|
9
|
-
min-agent
|
|
36
|
+
min-agent setup # Configure your AI provider
|
|
37
|
+
min-agent # Start chatting
|
|
10
38
|
```
|
|
11
39
|
|
|
12
|
-
##
|
|
40
|
+
## Basic Usage
|
|
13
41
|
|
|
14
42
|
```bash
|
|
15
|
-
min-agent
|
|
16
|
-
min-agent
|
|
17
|
-
min-agent "
|
|
18
|
-
min-agent
|
|
19
|
-
min-agent
|
|
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
|
|
20
50
|
```
|
|
21
51
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Commands
|
|
52
|
+
Attach an image or pick a specific model/provider for one message:
|
|
25
53
|
|
|
26
54
|
```bash
|
|
27
|
-
min-agent
|
|
28
|
-
min-agent
|
|
29
|
-
min-agent
|
|
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
|
|
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"
|
|
60
58
|
```
|
|
61
59
|
|
|
62
|
-
##
|
|
60
|
+
## While Chatting
|
|
63
61
|
|
|
64
|
-
Type `/`
|
|
62
|
+
Type `/` to open a command menu. Use **↑ / ↓** to recall previous messages.
|
|
65
63
|
|
|
66
64
|
| Command | Description |
|
|
67
|
-
|
|
68
|
-
| `/new` | Start a new session
|
|
69
|
-
| `/
|
|
70
|
-
| `/
|
|
71
|
-
| `/
|
|
72
|
-
| `/
|
|
73
|
-
| `/memory
|
|
74
|
-
| `/
|
|
75
|
-
| `/
|
|
76
|
-
| `/
|
|
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 |
|
|
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
|
+
| `/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 |
|
|
85
75
|
| `/attach <path>` | Attach a local image |
|
|
86
|
-
| `/
|
|
87
|
-
| `/
|
|
88
|
-
| `/
|
|
89
|
-
| `/
|
|
90
|
-
| `/path` | Working directory |
|
|
91
|
-
| `/help` | All commands |
|
|
76
|
+
| `/mcp` | Show connected MCP servers |
|
|
77
|
+
| `/skills` | Manage skills |
|
|
78
|
+
| `/tokens` | Usage and estimated cost |
|
|
79
|
+
| `/help` | Show all commands |
|
|
92
80
|
| `/exit` | Exit |
|
|
93
81
|
|
|
94
|
-
**Ctrl+C** clears the input
|
|
95
|
-
|
|
96
|
-
授权确认时 **[y] / [N]** 始终留在窗口底部;详情过长时用 **↑↓** 或 **PageUp / PageDown** 滚动,不必翻到消息区底部。提问输入行同样固定可见。
|
|
97
|
-
|
|
98
|
-
**鼠标** 在消息区拖拽选择文本,松开自动复制;双击选词、三击选中该条可见内容。复制时不含 `>` 与工具前缀。状态栏会短暂提示"已复制"。
|
|
99
|
-
|
|
100
|
-
---
|
|
82
|
+
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.
|
|
101
83
|
|
|
102
|
-
##
|
|
84
|
+
## Staying in Control
|
|
103
85
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```json
|
|
107
|
-
// ~/.min-agent/config.json
|
|
108
|
-
{
|
|
109
|
-
"providers": [
|
|
110
|
-
{
|
|
111
|
-
"name": "default",
|
|
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
|
-
}
|
|
128
|
-
```
|
|
86
|
+
min-agent asks for confirmation before risky actions by default.
|
|
129
87
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"disabledSkills": ["noisy-skill"],
|
|
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
|
-
}
|
|
88
|
+
```bash
|
|
89
|
+
min-agent permission # Show current setting
|
|
90
|
+
min-agent --permission ask # Confirm before risky actions (default)
|
|
91
|
+
min-agent --permission accept-edits # Auto-approve file edits only
|
|
92
|
+
min-agent --permission allow-all # Auto-approve everything — use with care
|
|
145
93
|
```
|
|
146
94
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Isolation is **off by default**. `--permission` / `--yes` only skip confirmations; they do not change isolation.
|
|
150
|
-
|
|
151
|
-
`--permission ask|accept-edits|allow-all` without a message writes config and exits (same as `min-agent permission …`). With a message, `--resume`, `--model`, or `--provider`, it only overrides that session. `--yes` / `-y` is this session only (same as `--permission allow-all`) and does not write config.
|
|
95
|
+
You can also limit what it's allowed to touch on your machine:
|
|
152
96
|
|
|
153
97
|
```bash
|
|
154
|
-
min-agent
|
|
155
|
-
min-agent
|
|
156
|
-
min-agent
|
|
157
|
-
min-agent --permission allow-all "msg" # this session only; does not write config
|
|
98
|
+
min-agent sandbox # Show current restriction level
|
|
99
|
+
min-agent sandbox off # No restriction (default)
|
|
100
|
+
min-agent sandbox workspace # Only allow changes inside the current folder
|
|
158
101
|
```
|
|
159
102
|
|
|
160
|
-
|
|
103
|
+
## Memory
|
|
161
104
|
|
|
162
|
-
|
|
105
|
+
Remembered notes are off by default. Turn them on when you want facts to persist across sessions:
|
|
163
106
|
|
|
164
107
|
```bash
|
|
165
|
-
min-agent
|
|
166
|
-
min-agent
|
|
167
|
-
min-agent --
|
|
168
|
-
min-agent
|
|
169
|
-
min-agent sandbox network deny
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
```json
|
|
173
|
-
"sandbox": {
|
|
174
|
-
"mode": "workspace",
|
|
175
|
-
"network": "allow",
|
|
176
|
-
"extraWriteRoots": ["/path/allowed-to-write"],
|
|
177
|
-
"extraReadRoots": []
|
|
178
|
-
}
|
|
108
|
+
min-agent memory # Show the switch and stored notes
|
|
109
|
+
min-agent memory on # Turn memory on (writes config)
|
|
110
|
+
min-agent --memory on # Same; with a message, this session only
|
|
111
|
+
min-agent memory add "prefer bun"
|
|
179
112
|
```
|
|
180
113
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
Project memories live in `.min-agent/memory.json`; global memories in `~/.min-agent/memory.json`. The agent reads project first, then global. Saving without `--project` / `--global` uses the project file when `.min-agent/` exists.
|
|
114
|
+
In chat, `/memory on` or `/memory off` toggles it; `/memory` lists notes; `/memory some text` saves one.
|
|
184
115
|
|
|
185
|
-
|
|
116
|
+
## Configuration
|
|
186
117
|
|
|
187
|
-
|
|
118
|
+
Run `min-agent setup` for a guided setup — this is the easiest way to add or switch AI providers.
|
|
188
119
|
|
|
189
|
-
`
|
|
120
|
+
Settings live in `~/.min-agent/config.json` (global). A project can have its own `.min-agent/config.json` that only applies there.
|
|
190
121
|
|
|
191
|
-
|
|
122
|
+
## Extending It
|
|
192
123
|
|
|
193
|
-
|
|
124
|
+
- **MCP servers** — connect external tools and data sources: `min-agent mcp -h`
|
|
125
|
+
- **Skills** — reusable instructions the agent loads automatically: `min-agent skills -h`
|
|
126
|
+
- **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
127
|
|
|
195
|
-
|
|
128
|
+
## API Access
|
|
196
129
|
|
|
197
|
-
|
|
130
|
+
`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
131
|
|
|
199
|
-
|
|
132
|
+
## License
|
|
200
133
|
|
|
201
|
-
|
|
134
|
+
MIT
|
|
202
135
|
|
|
203
|
-
|
|
136
|
+
<br>
|
|
204
137
|
|
|
205
138
|
---
|
|
206
139
|
|
|
207
|
-
|
|
140
|
+
<br>
|
|
208
141
|
|
|
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
|
-
```
|
|
142
|
+
<a id="简体中文"></a>
|
|
223
143
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
-
```
|
|
144
|
+
# 🇨🇳 简体中文
|
|
145
|
+
|
|
146
|
+
> 一款可在终端里运行的极简 AI 编程助手,支持 OpenAI、Ollama 以及任何兼容 OpenAI 接口的服务商。
|
|
254
147
|
|
|
255
|
-
-
|
|
256
|
-
- `timeout`:连接与调用共用的旧字段;`connectTimeout` / `callTimeout` 可分别覆盖
|
|
257
|
-
- 连接失败时错误信息会带上服务器 stderr 的最后几行,便于排查
|
|
148
|
+
<sub>[🔝 返回语言选择](#min-agent) · [🇬🇧 Switch to English](#english)</sub>
|
|
258
149
|
|
|
259
|
-
##
|
|
150
|
+
## 快速上手
|
|
260
151
|
|
|
261
152
|
```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
|
|
153
|
+
npm install -g min-agent
|
|
154
|
+
min-agent setup # 配置你的 AI 服务商
|
|
155
|
+
min-agent # 开始对话
|
|
271
156
|
```
|
|
272
157
|
|
|
273
|
-
|
|
274
|
-
Project wins over global, so disabling a repo-local skill never affects other repos.
|
|
158
|
+
## 基本用法
|
|
275
159
|
|
|
276
|
-
|
|
277
|
-
|
|
160
|
+
```bash
|
|
161
|
+
min-agent # 进入交互会话
|
|
162
|
+
min-agent "你的消息" # 进入交互会话并立即发送消息
|
|
163
|
+
min-agent exec "你的消息" # 单次提问后自动退出
|
|
164
|
+
min-agent --resume <id> # 恢复之前的会话
|
|
165
|
+
min-agent history # 查看已保存的会话
|
|
166
|
+
min-agent models # 查看可用模型
|
|
167
|
+
min-agent update # 升级到最新版本
|
|
168
|
+
```
|
|
278
169
|
|
|
279
|
-
|
|
170
|
+
为单条消息附带图片,或指定模型/服务商:
|
|
280
171
|
|
|
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...
|
|
172
|
+
```bash
|
|
173
|
+
min-agent -i photo.png "这张图片是什么?"
|
|
174
|
+
min-agent -m gpt-5.5 "你的消息"
|
|
175
|
+
min-agent --provider anthropic "你的消息"
|
|
293
176
|
```
|
|
294
177
|
|
|
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.
|
|
178
|
+
## 对话中的操作
|
|
301
179
|
|
|
302
|
-
|
|
180
|
+
输入 `/` 弹出命令菜单。使用 **↑ / ↓** 翻看之前的消息。
|
|
303
181
|
|
|
304
|
-
|
|
|
305
|
-
|
|
306
|
-
|
|
|
307
|
-
|
|
|
308
|
-
| `
|
|
182
|
+
| 命令 | 说明 |
|
|
183
|
+
|---|---|
|
|
184
|
+
| `/new` | 开始新会话 |
|
|
185
|
+
| `/model` | 切换模型 |
|
|
186
|
+
| `/provider` | 切换服务商 |
|
|
187
|
+
| `/plan` | 切换"计划模式"(只看不改) |
|
|
188
|
+
| `/think` | 选择思考强度 |
|
|
189
|
+
| `/memory` | 开关记忆,或保存一条 |
|
|
190
|
+
| `/undo` | 撤销上一轮操作 |
|
|
191
|
+
| `/diff` | 查看当前已产生的文件改动 |
|
|
192
|
+
| `/sessions` | 查看或切换会话 |
|
|
193
|
+
| `/attach <路径>` | 附加本地图片 |
|
|
194
|
+
| `/mcp` | 查看已连接的 MCP 服务 |
|
|
195
|
+
| `/skills` | 管理技能 |
|
|
196
|
+
| `/tokens` | 查看用量与预估费用 |
|
|
197
|
+
| `/help` | 查看全部命令 |
|
|
198
|
+
| `/exit` | 退出 |
|
|
309
199
|
|
|
310
|
-
|
|
200
|
+
快捷键:**Ctrl+C** 清空输入框(连按两次退出)· **Ctrl+V** 粘贴图片 · 多行粘贴会收成片段 · **Ctrl+B** 选中文本以复制 · 也支持鼠标拖拽选中并自动复制 · 点击工具或思考块可展开或收起。
|
|
311
201
|
|
|
312
|
-
|
|
202
|
+
## 掌控风险
|
|
313
203
|
|
|
314
|
-
|
|
204
|
+
min-agent 默认会在执行有风险的操作前先询问你。
|
|
315
205
|
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
206
|
+
```bash
|
|
207
|
+
min-agent permission # 查看当前设置
|
|
208
|
+
min-agent --permission ask # 有风险操作前先询问(默认)
|
|
209
|
+
min-agent --permission accept-edits # 仅自动批准文件修改
|
|
210
|
+
min-agent --permission allow-all # 自动批准所有操作 —— 请谨慎使用
|
|
322
211
|
```
|
|
323
212
|
|
|
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
|
-
}
|
|
213
|
+
也可以限制它能在你电脑上访问的范围:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
min-agent sandbox # 查看当前限制级别
|
|
217
|
+
min-agent sandbox off # 不限制(默认)
|
|
218
|
+
min-agent sandbox workspace # 仅允许修改当前项目文件夹内的内容
|
|
336
219
|
```
|
|
337
220
|
|
|
338
|
-
|
|
221
|
+
## 记忆
|
|
339
222
|
|
|
340
|
-
|
|
223
|
+
跨会话记忆默认关闭。需要记住偏好或项目约定时再打开:
|
|
341
224
|
|
|
342
225
|
```bash
|
|
343
|
-
min-agent
|
|
226
|
+
min-agent memory # 查看开关与已保存内容
|
|
227
|
+
min-agent memory on # 开启记忆(写入配置)
|
|
228
|
+
min-agent --memory on # 同上;若同时带消息则只对本轮生效
|
|
229
|
+
min-agent memory add "prefer bun"
|
|
344
230
|
```
|
|
345
231
|
|
|
346
|
-
|
|
232
|
+
对话里用 `/memory on` 或 `/memory off` 开关;`/memory` 查看;`/memory 一段话` 保存一条。
|
|
347
233
|
|
|
348
|
-
|
|
234
|
+
## 配置
|
|
235
|
+
|
|
236
|
+
运行 `min-agent setup` 即可通过引导式流程完成配置,这是添加或切换 AI 服务商最简单的方式。
|
|
237
|
+
|
|
238
|
+
配置保存在 `~/.min-agent/config.json`(全局生效)。也可以在某个项目下单独创建 `.min-agent/config.json`,仅对该项目生效。
|
|
239
|
+
|
|
240
|
+
## 扩展能力
|
|
241
|
+
|
|
242
|
+
- **MCP 服务**:连接外部工具与数据源,运行 `min-agent mcp -h` 了解详情
|
|
243
|
+
- **技能(Skills)**:可自动加载的可复用指令集,运行 `min-agent skills -h` 了解详情
|
|
244
|
+
- **项目规则**:在项目根目录添加 `AGENTS.md` 或 `RULES.md` 编写自定义指令;全局规则写入 `~/.min-agent/rules.md`
|
|
245
|
+
|
|
246
|
+
## API 接入
|
|
349
247
|
|
|
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) |
|
|
248
|
+
`min-agent serve` 可启动本地 HTTP API 服务,供其他应用调用。完整说明见 [docs/API.md](docs/API.md)
|
|
364
249
|
|
|
365
250
|
## License
|
|
366
251
|
|