mini-agents-cli 0.0.1 โ 0.0.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
|
@@ -1 +1,141 @@
|
|
|
1
|
-
|
|
1
|
+
# mini-agents-cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/mini-agents-cli)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
An interactive command-line tool built on top of the [mini-agents](https://www.npmjs.com/package/mini-agents) framework.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- ๐ **Out-of-the-box**: Zero-configuration setup with interactive onboarding
|
|
11
|
+
- ๐ฌ **Interactive Chat**: Real-time conversation with AI Agent
|
|
12
|
+
- ๐ ๏ธ **Built-in Tools**: File operations, shell execution, and skill system
|
|
13
|
+
- โจ๏ธ **Keyboard Shortcuts**: Support for command history, auto-completion, and cancellation
|
|
14
|
+
- โ๏ธ **Configurable**: Persistent settings with JSON configuration files
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
### Global Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g mini-agents-cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### First Run
|
|
27
|
+
|
|
28
|
+
Simply run the CLI:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
mini-agents-cli
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
On first run, you'll be guided through an interactive setup:
|
|
35
|
+
1. Choose your LLM provider (Anthropic or OpenAI)
|
|
36
|
+
2. Enter your API key
|
|
37
|
+
3. Configure API base URL and model
|
|
38
|
+
|
|
39
|
+
Configuration is saved to `~/.mini-agents-cli/settings.json`.
|
|
40
|
+
|
|
41
|
+
### Commands
|
|
42
|
+
|
|
43
|
+
Once in the CLI, you can use the following commands:
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| `/help` | Show help information |
|
|
48
|
+
| `/clear` | Clear the screen |
|
|
49
|
+
| `/exit` or `/quit` | Exit the CLI |
|
|
50
|
+
|
|
51
|
+
### Keyboard Shortcuts
|
|
52
|
+
|
|
53
|
+
| Shortcut | Description |
|
|
54
|
+
|----------|-------------|
|
|
55
|
+
| `Ctrl+C` | Exit the CLI |
|
|
56
|
+
| `Esc` | Cancel current Agent execution |
|
|
57
|
+
| `โ/โ` | Navigate command history |
|
|
58
|
+
| `Tab` | Auto-complete commands |
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
### Configuration File
|
|
63
|
+
|
|
64
|
+
Location: `~/.mini-agents-cli/settings.json`
|
|
65
|
+
|
|
66
|
+
Example configuration:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"llm": {
|
|
71
|
+
"apiKey": "your-api-key",
|
|
72
|
+
"apiBase": "https://api.anthropic.com",
|
|
73
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
74
|
+
"provider": "anthropic",
|
|
75
|
+
"retry": {
|
|
76
|
+
"enabled": true,
|
|
77
|
+
"maxRetries": 3,
|
|
78
|
+
"initialDelay": 1.0,
|
|
79
|
+
"maxDelay": 60.0,
|
|
80
|
+
"exponentialBase": 2.0
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"agent": {
|
|
84
|
+
"maxSteps": 50,
|
|
85
|
+
"workspaceDir": "./workspace",
|
|
86
|
+
"systemPromptPath": "system_prompt.md"
|
|
87
|
+
},
|
|
88
|
+
"tools": {
|
|
89
|
+
"enableFileTools": true,
|
|
90
|
+
"enableBash": true,
|
|
91
|
+
"enableNote": true,
|
|
92
|
+
"enableSkills": true,
|
|
93
|
+
"skillsDir": "./skills",
|
|
94
|
+
"enableMcp": true,
|
|
95
|
+
"mcpConfigPath": "mcp.json"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Environment Variables
|
|
101
|
+
|
|
102
|
+
You can also use environment variables:
|
|
103
|
+
|
|
104
|
+
- `ANTHROPIC_API_KEY` - Anthropic API key
|
|
105
|
+
- `ANTHROPIC_API_BASE_URL` - Anthropic API base URL
|
|
106
|
+
- `OPENAI_API_KEY` - OpenAI API key
|
|
107
|
+
- `OPENAI_API_BASE_URL` - OpenAI API base URL
|
|
108
|
+
|
|
109
|
+
### Workspace Directory
|
|
110
|
+
|
|
111
|
+
By default, the CLI operates in the current working directory. You can specify a different workspace:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
mini-agents-cli --workspace /path/to/project
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Skills
|
|
118
|
+
|
|
119
|
+
Skills are reusable capabilities that the Agent can invoke. Place your skill files (`.md` format) in the `skills/` directory.
|
|
120
|
+
|
|
121
|
+
Example skill structure:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
skills/
|
|
125
|
+
โโโ web-search.md
|
|
126
|
+
โโโ code-review.md
|
|
127
|
+
โโโ data-analysis.md
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Requirements
|
|
131
|
+
|
|
132
|
+
- Node.js 18+
|
|
133
|
+
- API key from Anthropic or OpenAI
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT
|
|
138
|
+
|
|
139
|
+
## Related
|
|
140
|
+
|
|
141
|
+
- [mini-agents](https://www.npmjs.com/package/mini-agents) - The underlying Agent framework
|
package/dist/index.mjs
CHANGED
|
@@ -26,7 +26,7 @@ const RetryConfigSchema = z.object({
|
|
|
26
26
|
/** LLM ้
็ฝฎ schema */
|
|
27
27
|
const LLMConfigSchema = z.object({
|
|
28
28
|
apiKey: z.string(),
|
|
29
|
-
|
|
29
|
+
apiBaseURL: z.string(),
|
|
30
30
|
model: z.string(),
|
|
31
31
|
provider: z.enum(["anthropic", "openai"]),
|
|
32
32
|
retry: z.unknown().default({}).pipe(RetryConfigSchema)
|
|
@@ -69,7 +69,7 @@ const LOCAL_SETTINGS_FILE = "settings.json";
|
|
|
69
69
|
/** ้ป่ฎค้
็ฝฎๆจกๆฟ */
|
|
70
70
|
const DEFAULT_SETTINGS = { llm: {
|
|
71
71
|
apiKey: "YOUR_API_KEY_HERE",
|
|
72
|
-
|
|
72
|
+
apiBaseURL: "https://api.anthropic.com",
|
|
73
73
|
model: "claude-sonnet-4-20250514",
|
|
74
74
|
provider: "anthropic"
|
|
75
75
|
} };
|
|
@@ -178,7 +178,7 @@ var SimpleCLI = class {
|
|
|
178
178
|
const llmClient = new LLMClient({
|
|
179
179
|
apiKey: this.settings.llm.apiKey,
|
|
180
180
|
provider: this.settings.llm.provider,
|
|
181
|
-
|
|
181
|
+
apiBaseURL: this.settings.llm.apiBaseURL,
|
|
182
182
|
model: this.settings.llm.model
|
|
183
183
|
});
|
|
184
184
|
const tools = [];
|
|
@@ -408,7 +408,7 @@ const program = new Command();
|
|
|
408
408
|
program.name("mini-agents-cli").description("Mini Agent - AI assistant with tool support").version("0.3.0").option("-w, --workspace <dir>", "Workspace directory", process.cwd()).action(async (options) => {
|
|
409
409
|
let settingsPath = findSettingsFile();
|
|
410
410
|
if (!settingsPath) {
|
|
411
|
-
const { runOnboarding } = await import("./onboarding-
|
|
411
|
+
const { runOnboarding } = await import("./onboarding-B70ZsuMX.mjs");
|
|
412
412
|
settingsPath = await runOnboarding();
|
|
413
413
|
}
|
|
414
414
|
let settings;
|
|
@@ -18,11 +18,11 @@ const RESET = "\x1B[0m";
|
|
|
18
18
|
/** Provider ้ข่ฎพ */
|
|
19
19
|
const PROVIDER_PRESETS = {
|
|
20
20
|
anthropic: {
|
|
21
|
-
|
|
21
|
+
apiBaseURL: "https://api.anthropic.com",
|
|
22
22
|
model: "claude-sonnet-4-20250514"
|
|
23
23
|
},
|
|
24
24
|
openai: {
|
|
25
|
-
|
|
25
|
+
apiBaseURL: "https://api.openai.com/v1",
|
|
26
26
|
model: "gpt-4o"
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -53,8 +53,8 @@ async function runOnboarding() {
|
|
|
53
53
|
if (!apiKey.trim()) console.log(`${YELLOW}โ No API key provided. You can edit the config later.${RESET}`);
|
|
54
54
|
console.log();
|
|
55
55
|
console.log(`${BOLD}${YELLOW}[3/4] API Base URL${RESET}`);
|
|
56
|
-
const
|
|
57
|
-
console.log(` โ ${CYAN}${
|
|
56
|
+
const apiBaseURL = (await rl.question(`${DIM}URL (default: ${preset.apiBaseURL}): ${RESET}`)).trim() || preset.apiBaseURL;
|
|
57
|
+
console.log(` โ ${CYAN}${apiBaseURL}${RESET}`);
|
|
58
58
|
console.log();
|
|
59
59
|
console.log(`${BOLD}${YELLOW}[4/4] Model${RESET}`);
|
|
60
60
|
const model = (await rl.question(`${DIM}Model name (default: ${preset.model}): ${RESET}`)).trim() || preset.model;
|
|
@@ -64,7 +64,7 @@ async function runOnboarding() {
|
|
|
64
64
|
const { writeFileSync } = await import("node:fs");
|
|
65
65
|
const settings = { llm: {
|
|
66
66
|
apiKey: apiKey.trim() || "YOUR_API_KEY_HERE",
|
|
67
|
-
|
|
67
|
+
apiBaseURL,
|
|
68
68
|
model,
|
|
69
69
|
provider
|
|
70
70
|
} };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mini-agents-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "A mini AI agent in CLI",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"bin": {
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
],
|
|
18
18
|
"author": "",
|
|
19
19
|
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/liruifengv/mini-agents.git",
|
|
23
|
+
"directory": "packages/mini-agents-cli"
|
|
24
|
+
},
|
|
20
25
|
"devDependencies": {
|
|
21
26
|
"@types/node": "^20.0.0",
|
|
22
27
|
"tsdown": "^0.16.6",
|
|
@@ -26,10 +31,11 @@
|
|
|
26
31
|
"dependencies": {
|
|
27
32
|
"commander": "^12.0.0",
|
|
28
33
|
"zod": "^4.1.12",
|
|
29
|
-
"mini-agents": "0.0.
|
|
34
|
+
"mini-agents": "0.0.2"
|
|
30
35
|
},
|
|
31
36
|
"publishConfig": {
|
|
32
|
-
"access": "public"
|
|
37
|
+
"access": "public",
|
|
38
|
+
"provenance": true
|
|
33
39
|
},
|
|
34
40
|
"scripts": {
|
|
35
41
|
"build": "tsdown",
|