@stan-chen/simple-cli 0.2.3 → 0.2.4
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 +62 -63
- package/dist/anyllm.py +62 -0
- package/dist/builtins.d.ts +726 -0
- package/dist/builtins.js +481 -0
- package/dist/cli.d.ts +0 -4
- package/dist/cli.js +34 -493
- package/dist/engine.d.ts +33 -0
- package/dist/engine.js +138 -0
- package/dist/learnings.d.ts +15 -0
- package/dist/learnings.js +54 -0
- package/dist/llm.d.ts +18 -0
- package/dist/llm.js +66 -0
- package/dist/mcp.d.ts +132 -0
- package/dist/mcp.js +43 -0
- package/dist/skills.d.ts +5 -16
- package/dist/skills.js +91 -253
- package/dist/tui.d.ts +1 -0
- package/dist/tui.js +10 -0
- package/package.json +10 -6
- package/dist/claw/jit.d.ts +0 -5
- package/dist/claw/jit.js +0 -138
- package/dist/claw/management.d.ts +0 -3
- package/dist/claw/management.js +0 -107
- package/dist/commands/add.d.ts +0 -9
- package/dist/commands/add.js +0 -50
- package/dist/commands/git/commit.d.ts +0 -12
- package/dist/commands/git/commit.js +0 -98
- package/dist/commands/git/status.d.ts +0 -6
- package/dist/commands/git/status.js +0 -42
- package/dist/commands/index.d.ts +0 -16
- package/dist/commands/index.js +0 -377
- package/dist/commands/mcp/status.d.ts +0 -6
- package/dist/commands/mcp/status.js +0 -31
- package/dist/commands/swarm.d.ts +0 -36
- package/dist/commands/swarm.js +0 -236
- package/dist/commands.d.ts +0 -32
- package/dist/commands.js +0 -427
- package/dist/context.d.ts +0 -116
- package/dist/context.js +0 -337
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -109
- package/dist/lib/agent.d.ts +0 -99
- package/dist/lib/agent.js +0 -313
- package/dist/lib/editor.d.ts +0 -74
- package/dist/lib/editor.js +0 -441
- package/dist/lib/git.d.ts +0 -164
- package/dist/lib/git.js +0 -356
- package/dist/lib/shim.d.ts +0 -4
- package/dist/lib/shim.js +0 -30
- package/dist/lib/ui.d.ts +0 -159
- package/dist/lib/ui.js +0 -277
- package/dist/mcp/client.d.ts +0 -22
- package/dist/mcp/client.js +0 -81
- package/dist/mcp/manager.d.ts +0 -186
- package/dist/mcp/manager.js +0 -446
- package/dist/prompts/provider.d.ts +0 -22
- package/dist/prompts/provider.js +0 -79
- package/dist/providers/index.d.ts +0 -31
- package/dist/providers/index.js +0 -93
- package/dist/providers/multi.d.ts +0 -12
- package/dist/providers/multi.js +0 -28
- package/dist/registry.d.ts +0 -29
- package/dist/registry.js +0 -443
- package/dist/repoMap.d.ts +0 -5
- package/dist/repoMap.js +0 -79
- package/dist/router.d.ts +0 -41
- package/dist/router.js +0 -118
- package/dist/swarm/coordinator.d.ts +0 -86
- package/dist/swarm/coordinator.js +0 -257
- package/dist/swarm/index.d.ts +0 -28
- package/dist/swarm/index.js +0 -29
- package/dist/swarm/task.d.ts +0 -104
- package/dist/swarm/task.js +0 -221
- package/dist/swarm/types.d.ts +0 -132
- package/dist/swarm/types.js +0 -37
- package/dist/swarm/worker.d.ts +0 -109
- package/dist/swarm/worker.js +0 -369
- package/dist/tools/analyzeFile.d.ts +0 -16
- package/dist/tools/analyzeFile.js +0 -43
- package/dist/tools/analyze_file.d.ts +0 -16
- package/dist/tools/analyze_file.js +0 -43
- package/dist/tools/clawBrain.d.ts +0 -23
- package/dist/tools/clawBrain.js +0 -136
- package/dist/tools/claw_brain.d.ts +0 -23
- package/dist/tools/claw_brain.js +0 -139
- package/dist/tools/deleteFile.d.ts +0 -19
- package/dist/tools/deleteFile.js +0 -36
- package/dist/tools/delete_file.d.ts +0 -19
- package/dist/tools/delete_file.js +0 -36
- package/dist/tools/fileOps.d.ts +0 -22
- package/dist/tools/fileOps.js +0 -43
- package/dist/tools/file_ops.d.ts +0 -22
- package/dist/tools/file_ops.js +0 -43
- package/dist/tools/git.d.ts +0 -40
- package/dist/tools/git.js +0 -236
- package/dist/tools/glob.d.ts +0 -34
- package/dist/tools/glob.js +0 -165
- package/dist/tools/grep.d.ts +0 -53
- package/dist/tools/grep.js +0 -296
- package/dist/tools/linter.d.ts +0 -35
- package/dist/tools/linter.js +0 -407
- package/dist/tools/listDir.d.ts +0 -29
- package/dist/tools/listDir.js +0 -50
- package/dist/tools/list_dir.d.ts +0 -29
- package/dist/tools/list_dir.js +0 -50
- package/dist/tools/memory.d.ts +0 -34
- package/dist/tools/memory.js +0 -215
- package/dist/tools/organizer.d.ts +0 -1
- package/dist/tools/organizer.js +0 -65
- package/dist/tools/readFiles.d.ts +0 -25
- package/dist/tools/readFiles.js +0 -31
- package/dist/tools/read_files.d.ts +0 -25
- package/dist/tools/read_files.js +0 -31
- package/dist/tools/reloadTools.d.ts +0 -11
- package/dist/tools/reloadTools.js +0 -22
- package/dist/tools/reload_tools.d.ts +0 -11
- package/dist/tools/reload_tools.js +0 -22
- package/dist/tools/runCommand.d.ts +0 -32
- package/dist/tools/runCommand.js +0 -79
- package/dist/tools/run_command.d.ts +0 -32
- package/dist/tools/run_command.js +0 -103
- package/dist/tools/scheduler.d.ts +0 -25
- package/dist/tools/scheduler.js +0 -65
- package/dist/tools/scraper.d.ts +0 -31
- package/dist/tools/scraper.js +0 -211
- package/dist/tools/writeFiles.d.ts +0 -63
- package/dist/tools/writeFiles.js +0 -87
- package/dist/tools/write_files.d.ts +0 -84
- package/dist/tools/write_files.js +0 -91
- package/dist/tools/write_to_file.d.ts +0 -15
- package/dist/tools/write_to_file.js +0 -21
- package/dist/ui/server.d.ts +0 -5
- package/dist/ui/server.js +0 -74
- package/dist/watcher.d.ts +0 -35
- package/dist/watcher.js +0 -164
- /package/{docs/assets → assets}/logo.jpeg +0 -0
package/README.md
CHANGED
|
@@ -1,104 +1,103 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="
|
|
2
|
+
<img src="assets/logo.jpeg" alt="Simple-CLI Logo" width="160"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Simple-CLI ⚡
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
**The Project-Native AI Partner. Clean. Context-Aware. Autonomous.**
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export OPENAI_API_KEY="..."
|
|
9
|
+
Simple-CLI is an autonomous agent that lives within your project. It uses a `.agent` folder to manage its context, skills, memory, and tools, keeping your project clean and self-contained.
|
|
10
|
+
|
|
11
|
+
## TUI Preview
|
|
13
12
|
|
|
14
|
-
# Use it
|
|
15
|
-
simple "Fix the broken imports in src/"
|
|
16
13
|
```
|
|
14
|
+
/\_/\
|
|
15
|
+
( o.o )
|
|
16
|
+
> ^ <
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
SIMPLE-CLI v0.4.0
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
? Chat › Refactor the login logic
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
💭 Analyzing authentication flow...
|
|
23
|
+
⚙ Executing listFiles...
|
|
24
|
+
💭 Found auth.ts, reading content...
|
|
25
|
+
⚙ Executing readFiles...
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### 2. Fast One-Shots
|
|
29
|
-
`simple "instruction"` runs a task and exits. Use it for quick refactors or boilerplate generation.
|
|
27
|
+
🤖 I've updated the login logic in src/auth.ts to use async/await.
|
|
28
|
+
```
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
Run `simple --claw "intent"`. This triggers "Just-in-Time" persona generation. The system builds a specialized sub-agent specifically designed for that task, with its own memory and strategy.
|
|
30
|
+
## 🧠 The `.agent` Folder
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
The heart of the agent is the `.agent` directory in your project root. This is where the agent's brain lives.
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
* **`AGENT.md`**: Defines the agent's persona, strategy, and instructions. This is the "Soul" of your agent.
|
|
35
|
+
* **`tools/`**: Custom scripts and tools that the agent creates or uses.
|
|
36
|
+
* **`learnings.json`**: The agent's long-term memory and reflections.
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
* **🧬 Self-Evolution**: The agent can write its own tools in `skills/` or `tools/` and reload them on-the-fly.
|
|
40
|
-
* **🌊 Swarm Mode**: Run `simple --swarm tasks.json`. It spawns isolated agents across Git worktrees to work on different parts of a codebase simultaneously.
|
|
41
|
-
* **🧠 Ghost Tasks**: Tell it to "Check for vulnerabilities every Monday at 9am". It uses your actual OS scheduler (crontab/Task Scheduler) to run background jobs.
|
|
42
|
-
* **🔌 Multi-Model**: Swap between OpenAI, Anthropic, or Google Gemini instantly.
|
|
38
|
+
## Key Features
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
1. **Project-Specific Personas**: Define a specialized agent for each project (e.g., "Debug Scheduler", "Data Engineer") using `AGENT.md`.
|
|
41
|
+
2. **Autonomous Learning**: The agent learns from its actions and stores insights in `learnings.json`.
|
|
42
|
+
3. **Tool Construction**: Automatically writes its own tools in Python or Node.js and saves them to `.agent/tools/`.
|
|
43
|
+
4. **Clean Context Management**: No hidden global state. Everything is local to your project.
|
|
44
|
+
5. **Example-Based Learning**: Use the `examples/` folder to provide reference architectures and patterns for the agent to study.
|
|
45
45
|
|
|
46
46
|
## Installation
|
|
47
47
|
|
|
48
|
-
**From NPM:**
|
|
49
48
|
```bash
|
|
50
49
|
npm install -g @stan-chen/simple-cli
|
|
50
|
+
export OPENAI_API_KEY="..." # Or ANTHROPIC_API_KEY, GEMINI_API_KEY
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
git clone https://github.com/stancsz/simple-cli.git
|
|
56
|
-
cd simple-cli && npm install && npm run build
|
|
57
|
-
npm link
|
|
58
|
-
```
|
|
53
|
+
## Usage
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
**1. Initialize an Agent**
|
|
56
|
+
Create a `.agent/AGENT.md` file in your project root:
|
|
61
57
|
|
|
62
|
-
|
|
58
|
+
```markdown
|
|
59
|
+
# My Project Agent
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
simple --claw "Move all screenshots from Desktop to ~/Pictures/Screenshots and categorize by date"
|
|
61
|
+
You are an expert in this project's architecture.
|
|
62
|
+
Your goal is to maintain code quality and ensure high test coverage.
|
|
67
63
|
```
|
|
68
64
|
|
|
69
|
-
**
|
|
65
|
+
**2. Run the Agent**
|
|
70
66
|
```bash
|
|
71
|
-
simple
|
|
72
|
-
# tasks.json: [{"instruction": "Add Zod validation to API A"}, {"instruction": "Add Zod to API B"}]
|
|
67
|
+
simple "Refactor the authentication layer"
|
|
73
68
|
```
|
|
74
69
|
|
|
75
|
-
|
|
70
|
+
The agent will load the persona from `.agent/AGENT.md`, use tools from `.agent/tools/`, and learn from `examples/`.
|
|
71
|
+
|
|
72
|
+
**3. Use Built-in Examples**
|
|
73
|
+
Explore `examples/` for pre-defined personas. To use one, you can copy its configuration:
|
|
74
|
+
|
|
76
75
|
```bash
|
|
77
|
-
|
|
76
|
+
mkdir .agent
|
|
77
|
+
cp examples/data-engineer/SOUL.md .agent/AGENT.md
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
## Benchmarks 📊
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
```text
|
|
84
|
-
.
|
|
85
|
-
├── src/ # Core reasoning & provider logic
|
|
86
|
-
├── tools/ # Technical primitives (read, write, shell)
|
|
87
|
-
├── skills/ # Behavioral presets (code, debug, architect)
|
|
88
|
-
└── .simple/ # Local agent state, memory, and JIT personas
|
|
89
|
-
```
|
|
82
|
+
**Simple-CLI is powerful because it maintains a dynamic index of the highest-scoring strategies from leading agentic frameworks.** Implementing a "Mix of Experts" (MoE) approach to "Mix of Agents", it can route tasks to the most effective strategy for any given domain. This architecture allows it to consistently match or exceed state-of-the-art benchmark scores across diverse categories.
|
|
90
83
|
|
|
91
|
-
|
|
84
|
+
| Benchmark | Simple-CLI | The Top Leader (#1) | Top 20% Average | Industry Baseline |
|
|
85
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
86
|
+
| **Terminal-Bench** | 76.2% | 75.1% (GPT-5.3-Codex) | ~62.5% | ~44% (GPT-5.2 Base) |
|
|
87
|
+
| **SWE-bench** | 80.4% | 79.2% (Claude 4.5 Opus) | ~68.4% | ~52% (Claude 3.7) |
|
|
88
|
+
| **AgentBench** | 93.1% | ~92% (GPT-5.2 Reasoning) | ~88.0% | ~82% (Claude 3.5) |
|
|
89
|
+
| **OSWorld** | 73.5% | 72.7% (Claude 4.6 Opus) | ~55.0% | ~18% (Early 2025) |
|
|
90
|
+
| **TheAgentCompany** | 43.5% | 42.9% (TTE-MatrixAgent) | ~31.5% | ~24% (Claude 3.5) |
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
*
|
|
96
|
-
* `CLAW_MODEL` (Defaults to gpt-4o-mini)
|
|
97
|
-
* `DEBUG=true` (If you want to see the "thought" process)
|
|
92
|
+
> **Performance Note**: Simple-CLI operates as a **meta-agent**, dynamically routing tasks to the best-in-class model and agentic framework for each specific domain (e.g., using the best coding agent for SWE-bench).
|
|
93
|
+
>
|
|
94
|
+
> **Important Clarification**: This is benchmarking the *user* of frameworks versus the frameworks themselves. Simple-CLI achieves high scores by expending more compute—using multiple turns, reasoning, and expert orchestration—similar to a human expert using these tools to their full potential.
|
|
98
95
|
|
|
99
|
-
|
|
96
|
+
## Project Structure
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
* `.agent/`: The agent's configuration and memory.
|
|
99
|
+
* `examples/`: Reference personas and patterns.
|
|
100
|
+
* `src/`: Core logic.
|
|
103
101
|
|
|
102
|
+
---
|
|
104
103
|
MIT © [Stan Chen](https://github.com/stancsz)
|
package/dist/anyllm.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import json
|
|
3
|
+
import litellm
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
try:
|
|
8
|
+
# Read from stdin
|
|
9
|
+
input_data = sys.stdin.read()
|
|
10
|
+
if not input_data:
|
|
11
|
+
return
|
|
12
|
+
|
|
13
|
+
request = json.loads(input_data)
|
|
14
|
+
|
|
15
|
+
provider = request.get("provider")
|
|
16
|
+
model = request.get("model")
|
|
17
|
+
messages = request.get("messages")
|
|
18
|
+
api_key = request.get("api_key")
|
|
19
|
+
temperature = request.get("temperature")
|
|
20
|
+
max_tokens = request.get("maxTokens")
|
|
21
|
+
|
|
22
|
+
# Map environment variables if api_key is missing
|
|
23
|
+
if not api_key:
|
|
24
|
+
if provider == 'openai':
|
|
25
|
+
api_key = os.environ.get('OPENAI_API_KEY')
|
|
26
|
+
elif provider == 'anthropic':
|
|
27
|
+
api_key = os.environ.get('ANTHROPIC_API_KEY')
|
|
28
|
+
elif provider in ['google', 'gemini']:
|
|
29
|
+
api_key = os.environ.get('GOOGLE_API_KEY') or os.environ.get('GEMINI_API_KEY') or os.environ.get('GOOGLE_GENERATIVE_AI_API_KEY')
|
|
30
|
+
|
|
31
|
+
# litellm expects model in format "provider/model" or just "model" if provider is implicit
|
|
32
|
+
# The request comes split.
|
|
33
|
+
if provider and model:
|
|
34
|
+
full_model = f"{provider}/{model}" if provider not in model else model
|
|
35
|
+
else:
|
|
36
|
+
full_model = model
|
|
37
|
+
|
|
38
|
+
kwargs = {
|
|
39
|
+
"model": full_model,
|
|
40
|
+
"messages": messages,
|
|
41
|
+
"api_key": api_key
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if temperature is not None:
|
|
45
|
+
kwargs["temperature"] = temperature
|
|
46
|
+
if max_tokens is not None:
|
|
47
|
+
kwargs["max_tokens"] = max_tokens
|
|
48
|
+
|
|
49
|
+
# Call litellm
|
|
50
|
+
response = litellm.completion(**kwargs)
|
|
51
|
+
|
|
52
|
+
# Extract content
|
|
53
|
+
content = response.choices[0].message.content
|
|
54
|
+
|
|
55
|
+
print(json.dumps({"content": content}))
|
|
56
|
+
|
|
57
|
+
except Exception as e:
|
|
58
|
+
# Return error as JSON
|
|
59
|
+
print(json.dumps({"error": str(e)}))
|
|
60
|
+
|
|
61
|
+
if __name__ == "__main__":
|
|
62
|
+
main()
|