@praveencs/agent 0.8.0 → 0.8.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.
|
@@ -7,8 +7,9 @@ This is the promise of **Autonomous Agents**. Unlike chatbots, agents have:
|
|
|
7
7
|
2. **Memory** (persistence across sessions)
|
|
8
8
|
3. **Skills** (integrations with real-world tools)
|
|
9
9
|
4. **Autonomy** (looping execution without constant prompts)
|
|
10
|
+
5. **Extensibility** (plugins, hooks, and commands to grow capabilities)
|
|
10
11
|
|
|
11
|
-
In this
|
|
12
|
+
In this 7-part series, we will break down exactly how we built `@praveencs/agent`, a powerful, open-source autonomous agent runtime.
|
|
12
13
|
|
|
13
14
|
## 🏗️ The Core Architecture
|
|
14
15
|
|
|
@@ -33,6 +34,16 @@ A developer who forgets the codebase every morning is useless. Our agent needs *
|
|
|
33
34
|
The secret sauce is the loop. A chatbot waits for input. An agent runs in a loop.
|
|
34
35
|
- **Role**: A background process that constantly checks for pending tasks, file changes, or new goals.
|
|
35
36
|
|
|
37
|
+
### 5. The Nervous System (Hooks & Plugins)
|
|
38
|
+
As of **v0.8.0**, our agent has a full extensibility layer:
|
|
39
|
+
- **Lifecycle Hooks**: Intercept execution at any point (`before:tool`, `after:plan`, etc.).
|
|
40
|
+
- **Lightweight Commands**: Markdown-based goal templates—no code needed.
|
|
41
|
+
- **Plugin System**: Install community bundles that add skills, commands, and hooks.
|
|
42
|
+
- **Multi-CLI Tools**: Delegate tasks to Cursor, Codex, Gemini, or Claude CLIs.
|
|
43
|
+
|
|
44
|
+
### 6. The Voice (Interactive CLI)
|
|
45
|
+
The agent now has a **conversational interface**. Type `agent` with no arguments to enter an interactive REPL with slash commands, tab completion, and multi-turn context.
|
|
46
|
+
|
|
36
47
|
## 🛠️ Tech Stack
|
|
37
48
|
|
|
38
49
|
We're building this in **TypeScript** (Node.js) because:
|
|
@@ -49,4 +60,13 @@ We're building this in **TypeScript** (Node.js) because:
|
|
|
49
60
|
|
|
50
61
|
In **Part 2**, we will dive into the code for **The Brain**. We'll write the `GoalDecomposer` class that turns vague requests into structured project plans.
|
|
51
62
|
|
|
63
|
+
### 📚 Full Series
|
|
64
|
+
1. **Architecture & Vision** (This Article)
|
|
65
|
+
2. **The Brain (Goal Decomposition)**
|
|
66
|
+
3. **The Body (Skill Execution)**
|
|
67
|
+
4. **The Memory (Persistence)**
|
|
68
|
+
5. **Self-Improvement (Auto-Fixer)**
|
|
69
|
+
6. **Plugin Ecosystem (Hooks, Commands, Multi-CLI)**
|
|
70
|
+
7. **Interactive CLI**
|
|
71
|
+
|
|
52
72
|
Stay tuned!
|
|
@@ -66,15 +66,12 @@ The LLM reads the errors ("not a git repository") and decides to add a check:
|
|
|
66
66
|
### 3. Apply & Reload
|
|
67
67
|
The agent overwrites `prompt.md` with the new version and reloads the skill instantly. The next execution uses the fixed logic.
|
|
68
68
|
|
|
69
|
-
## 🚀
|
|
69
|
+
## 🚀 But Wait, There's More
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
1. **Decomposes** vague goals into tasks.
|
|
73
|
-
2. **Executes** tasks using defined skills.
|
|
74
|
-
3. **Remembers** context and learnings.
|
|
75
|
-
4. **Monitors** itself and **Fixes** its own tools.
|
|
71
|
+
In **v0.8.0**, we took everything further. The agent is now extensible and conversational.
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
In **Part 6**, we'll cover the **Plugin Ecosystem**—hooks that intercept execution, lightweight commands, and multi-CLI orchestration.
|
|
74
|
+
In **Part 7**, we'll build the **Interactive CLI**—a Claude Code-style conversational experience.
|
|
78
75
|
|
|
79
76
|
### 📚 Series Recap
|
|
80
77
|
|
|
@@ -83,6 +80,8 @@ This loop—Plan, Do, Check, Act—is the foundation of autonomy.
|
|
|
83
80
|
- **Part 3**: The Body (Skill Execution)
|
|
84
81
|
- **Part 4**: The Memory (Persistence)
|
|
85
82
|
- **Part 5**: Self-Improvement (Auto-Fixer)
|
|
83
|
+
- **Part 6**: Plugin Ecosystem (Hooks, Commands, Multi-CLI)
|
|
84
|
+
- **Part 7**: Interactive CLI
|
|
86
85
|
|
|
87
86
|
You can explore the full source code and contribute at [GitHub](https://github.com/praveencs87/agent).
|
|
88
87
|
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# The Plugin Ecosystem: Hooks, Commands & Extensibility (Part 6)
|
|
2
|
+
|
|
3
|
+
In **Parts 1-5**, we built an agent with a brain, body, memory, and self-healing. But it was a closed system.
|
|
4
|
+
|
|
5
|
+
In **v0.8.0**, we opened it up. Now anyone can extend the agent with **Plugins**, **Hooks**, and **Commands**—without touching core code.
|
|
6
|
+
|
|
7
|
+
## 🪝 Lifecycle Hooks
|
|
8
|
+
|
|
9
|
+
Hooks let you inject custom logic at every execution point. Think of them as Git hooks, but for your agent.
|
|
10
|
+
|
|
11
|
+
### The Events
|
|
12
|
+
|
|
13
|
+
| Event | When it fires |
|
|
14
|
+
|-------|--------------|
|
|
15
|
+
| `before:tool` | Before any tool executes |
|
|
16
|
+
| `after:tool` | After any tool completes |
|
|
17
|
+
| `before:plan` | Before a plan starts |
|
|
18
|
+
| `after:step` | After each plan step |
|
|
19
|
+
| `after:plan` | After a plan finishes |
|
|
20
|
+
| `before:skill` / `after:skill` | Around skill execution |
|
|
21
|
+
| `after:decompose` | After goal decomposition |
|
|
22
|
+
| `session:start` / `session:end` | At session boundaries |
|
|
23
|
+
|
|
24
|
+
### Example: Auto-Format on Write
|
|
25
|
+
|
|
26
|
+
Create `.agent/hooks/hooks.json`:
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"hooks": {
|
|
30
|
+
"after:tool": [
|
|
31
|
+
{
|
|
32
|
+
"match": "fs.write",
|
|
33
|
+
"command": "npx prettier --write {{path}}",
|
|
34
|
+
"blocking": false
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"before:plan": [
|
|
38
|
+
{
|
|
39
|
+
"command": "./scripts/validate-env.sh",
|
|
40
|
+
"blocking": true
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Every time the agent writes a file, Prettier auto-formats it. Before every plan runs, your environment is validated.
|
|
48
|
+
|
|
49
|
+
### Template Variables
|
|
50
|
+
|
|
51
|
+
Hook commands support `{{name}}`, `{{event}}`, `{{cwd}}`, `{{path}}`, and `{{runId}}` placeholders. Environment variables like `AGENT_HOOK_EVENT` are also injected.
|
|
52
|
+
|
|
53
|
+
### CLI
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
agent hooks list # Show all registered hooks
|
|
57
|
+
agent hooks add after:tool "npx prettier --write {{path}}" --match fs.write
|
|
58
|
+
agent hooks events # Reference for all available events
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## ⚡ Lightweight Commands
|
|
64
|
+
|
|
65
|
+
Skills require a `skill.json`, an entrypoint, and permission declarations. But sometimes you just want a quick recipe.
|
|
66
|
+
|
|
67
|
+
**Commands** are markdown files with YAML frontmatter. No boilerplate.
|
|
68
|
+
|
|
69
|
+
### Example: `deploy-staging.md`
|
|
70
|
+
|
|
71
|
+
Create `.agent/commands/deploy-staging.md`:
|
|
72
|
+
```markdown
|
|
73
|
+
---
|
|
74
|
+
name: deploy-staging
|
|
75
|
+
description: Deploy current branch to staging
|
|
76
|
+
tools: [cmd.run, git.status, git.diff]
|
|
77
|
+
---
|
|
78
|
+
# Deploy to Staging
|
|
79
|
+
|
|
80
|
+
You are deploying the current branch to staging.
|
|
81
|
+
|
|
82
|
+
Steps:
|
|
83
|
+
1. Run `npm test` to verify all tests pass
|
|
84
|
+
2. Run `npm run build` to create the production bundle
|
|
85
|
+
3. Run `git push origin HEAD:staging` to trigger deployment
|
|
86
|
+
4. Verify the deployment succeeded
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### How It Works
|
|
90
|
+
|
|
91
|
+
When you run `agent run deploy-staging` or type `/deploy-staging` in interactive mode:
|
|
92
|
+
1. The runtime checks: Is there a **Skill** named `deploy-staging`? → No.
|
|
93
|
+
2. Is there a **Command** named `deploy-staging`? → **Yes!**
|
|
94
|
+
3. The command's markdown body becomes the LLM system prompt.
|
|
95
|
+
4. Only the whitelisted tools (`cmd.run`, `git.status`, `git.diff`) are available.
|
|
96
|
+
|
|
97
|
+
This gives you **scoped, repeatable tasks without any code**.
|
|
98
|
+
|
|
99
|
+
### CLI
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
agent commands list # Show all available commands
|
|
103
|
+
agent run deploy-staging # Run a command
|
|
104
|
+
agent run /deploy-staging # Explicit slash-command syntax
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🔧 Multi-CLI Orchestration
|
|
110
|
+
|
|
111
|
+
Sometimes, the best tool for a job isn't our agent—it's Cursor, Codex, or Claude CLI.
|
|
112
|
+
|
|
113
|
+
In v0.8.0, we added **first-class AI CLI wrappers** as tools. The LLM orchestrator can delegate sub-tasks to specialized CLIs:
|
|
114
|
+
|
|
115
|
+
| Tool | Wraps | Best For |
|
|
116
|
+
|------|-------|----------|
|
|
117
|
+
| `cli.cursor` | Cursor CLI | Multi-file refactoring with codebase context |
|
|
118
|
+
| `cli.codex` | OpenAI Codex | Code generation with sandbox execution |
|
|
119
|
+
| `cli.gemini` | Gemini CLI | Large-context analysis and reasoning |
|
|
120
|
+
| `cli.claude` | Claude CLI | Careful code review and generation |
|
|
121
|
+
|
|
122
|
+
### How It Works
|
|
123
|
+
|
|
124
|
+
These are standard `ToolDefinition` registrations—the LLM sees them alongside `fs.read`, `cmd.run`, and `git.diff`. When the task requires deep codebase understanding or parallel execution, the LLM can choose:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
User: "Refactor the auth module to use JWT"
|
|
128
|
+
Agent LLM: "This needs multi-file refactoring with deep context."
|
|
129
|
+
→ Calls cli.cursor({ prompt: "Refactor auth to JWT...", files: ["src/auth/**"] })
|
|
130
|
+
→ Cursor CLI executes with native codebase indexing
|
|
131
|
+
→ Result returned to our agent for verification
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Configure availability in `agent.config.json`:
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"cliTools": {
|
|
138
|
+
"cursor": { "binary": "cursor", "available": true },
|
|
139
|
+
"claude": { "binary": "claude", "available": true }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 🔌 The Plugin System
|
|
147
|
+
|
|
148
|
+
A **Plugin** bundles skills, commands, hooks, and tools into a single installable package.
|
|
149
|
+
|
|
150
|
+
### Plugin Structure
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
my-plugin/
|
|
154
|
+
├── .agent-plugin/
|
|
155
|
+
│ └── plugin.json # Manifest
|
|
156
|
+
├── skills/
|
|
157
|
+
│ └── security-scan/
|
|
158
|
+
│ ├── skill.json
|
|
159
|
+
│ └── prompt.md
|
|
160
|
+
├── commands/
|
|
161
|
+
│ └── audit.md
|
|
162
|
+
└── hooks/
|
|
163
|
+
└── hooks.json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Manifest (`plugin.json`)
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"name": "enterprise-security",
|
|
171
|
+
"version": "1.0.0",
|
|
172
|
+
"description": "Security scanning and compliance",
|
|
173
|
+
"skills": ["skills/"],
|
|
174
|
+
"commands": ["commands/"],
|
|
175
|
+
"hooks": "hooks/hooks.json"
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### CLI
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
agent plugins install ./my-plugin # Install from local path
|
|
183
|
+
agent plugins list # Show installed plugins
|
|
184
|
+
agent plugins remove my-plugin # Uninstall
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
When a plugin is installed, its skills, commands, and hooks are automatically loaded on every `agent` run.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 🚀 What's Next?
|
|
192
|
+
|
|
193
|
+
The plugin ecosystem opens the door to community contributions. Imagine installing `agent plugins install security-scanner` and instantly getting OWASP scanning as a hook on every build.
|
|
194
|
+
|
|
195
|
+
In **Part 7**, we'll cover the new **Interactive CLI**—the Claude Code-style conversational experience.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# The Interactive CLI: A Claude Code-Style Experience (Part 7)
|
|
2
|
+
|
|
3
|
+
In **Part 6**, we gave the agent extensibility. In **Part 7**, we give it a personality.
|
|
4
|
+
|
|
5
|
+
Most CLI tools are fire-and-forget: you type a command, get output, done. But modern AI agents deserve a **conversational interface**—one where you stay in a flow, the agent remembers context, and you can guide it naturally.
|
|
6
|
+
|
|
7
|
+
## 🤖 The REPL
|
|
8
|
+
|
|
9
|
+
When you type `agent` with no subcommand, you enter **Interactive Mode**:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ agent
|
|
13
|
+
|
|
14
|
+
╭────────────────────────────────────────────────╮
|
|
15
|
+
│ 🤖 Agent Runtime v0.8.0 │
|
|
16
|
+
│ Project: my-app │
|
|
17
|
+
│ Model: gpt-4o │ 3 skills │ 2 commands │
|
|
18
|
+
╰────────────────────────────────────────────────╯
|
|
19
|
+
|
|
20
|
+
Type a goal, a /command, or /help for help.
|
|
21
|
+
|
|
22
|
+
> Add input validation to the signup form
|
|
23
|
+
⠋ Thinking...
|
|
24
|
+
⚡ fs.read(src/pages/signup.tsx) ✓
|
|
25
|
+
⚡ fs.write(src/pages/signup.tsx) ✓
|
|
26
|
+
⚡ cmd.run(npm test) ✓
|
|
27
|
+
|
|
28
|
+
Added Zod validation schema for email and password fields.
|
|
29
|
+
Tests pass.
|
|
30
|
+
|
|
31
|
+
────────────────────────────────────────────────────────
|
|
32
|
+
✓ Done (8.2s)
|
|
33
|
+
|
|
34
|
+
> Now add rate limiting to the API endpoint
|
|
35
|
+
⠋ Thinking...
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Notice the second prompt: **the agent remembers** the first task. It knows you're working on the signup form and can connect the two requests.
|
|
39
|
+
|
|
40
|
+
## 🔑 Key Features
|
|
41
|
+
|
|
42
|
+
### 1. Multi-Turn Conversation
|
|
43
|
+
|
|
44
|
+
Unlike `agent run "do X"` (which is one-shot), the REPL maintains conversation history across turns. The `ConversationManager` (`src/cli/conversation.ts`) tracks all messages:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
conversation.addUser("Add validation");
|
|
48
|
+
// → LLM sees full history including previous turns
|
|
49
|
+
const messages = conversation.getMessages();
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
When context gets too long, use `/compact` to summarize and trim:
|
|
53
|
+
```
|
|
54
|
+
> /compact
|
|
55
|
+
Conversation compacted. Context freed.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. Slash Commands
|
|
59
|
+
|
|
60
|
+
Type `/` to access built-in commands:
|
|
61
|
+
|
|
62
|
+
| Command | What it does |
|
|
63
|
+
|---------|-------------|
|
|
64
|
+
| `/help` | Show all available commands |
|
|
65
|
+
| `/skills` | List installed skills with status |
|
|
66
|
+
| `/commands` | List available lightweight commands |
|
|
67
|
+
| `/hooks` | Show registered lifecycle hooks |
|
|
68
|
+
| `/model` | Display current model and providers |
|
|
69
|
+
| `/compact` | Summarize and trim conversation context |
|
|
70
|
+
| `/clear` | Clear the terminal screen |
|
|
71
|
+
| `/exit` | Exit interactive mode |
|
|
72
|
+
|
|
73
|
+
Your custom `.agent/commands/*.md` files are also available as slash commands! If you have `deploy-staging.md`, you can type `/deploy-staging`.
|
|
74
|
+
|
|
75
|
+
### 3. Tab Completion
|
|
76
|
+
|
|
77
|
+
Press `Tab` after `/` to see all available slash commands. The REPL uses readline's `completer` for instant autocompletion:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
> /sk<TAB>
|
|
81
|
+
> /skills
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 4. Inline Tool Execution
|
|
85
|
+
|
|
86
|
+
When the agent calls tools, you see them in real-time with status badges:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
⚡ fs.read(src/auth/handler.ts) ✓ # Success
|
|
90
|
+
⚡ cmd.run(npm test) ✗ Test failed # Failure with reason
|
|
91
|
+
⚡ cli.cursor(refactor auth...) ✓ # Delegated to external CLI
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 5. Rich Welcome Banner
|
|
95
|
+
|
|
96
|
+
The bordered banner shows at-a-glance info:
|
|
97
|
+
- Current project name (from `package.json`)
|
|
98
|
+
- Active LLM model
|
|
99
|
+
- Number of loaded skills and commands
|
|
100
|
+
|
|
101
|
+
## 🏗️ Architecture
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
bin/agent.ts
|
|
105
|
+
└── No subcommand?
|
|
106
|
+
└── startREPL() ← src/cli/repl.ts
|
|
107
|
+
├── Bootstrap (config, tools, skills, commands, hooks)
|
|
108
|
+
├── renderBanner()
|
|
109
|
+
└── readline loop
|
|
110
|
+
├── /slash-command → SlashCommandRegistry
|
|
111
|
+
├── /user-command → CommandLoader → LLM loop (scoped tools)
|
|
112
|
+
└── natural language → ConversationManager → LLM loop (all tools)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
All existing subcommands (`agent run`, `agent plan`, `agent skills`) continue to work exactly as before. The REPL is an *additional* entry point, not a replacement.
|
|
116
|
+
|
|
117
|
+
## 💻 Implementation Highlights
|
|
118
|
+
|
|
119
|
+
### Spinner Integration
|
|
120
|
+
|
|
121
|
+
We use `ora` for smooth loading states:
|
|
122
|
+
```typescript
|
|
123
|
+
const spinner = new Spinner();
|
|
124
|
+
spinner.start('Thinking...');
|
|
125
|
+
// ... LLM call ...
|
|
126
|
+
spinner.stop();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Tool Call Display
|
|
130
|
+
|
|
131
|
+
The `renderToolCall` function shows tool execution inline:
|
|
132
|
+
```typescript
|
|
133
|
+
renderToolCall('fs.read', { path: 'src/app.ts' }, 'running');
|
|
134
|
+
// Output: ⚡ fs.read({"path":"src/app.ts"})
|
|
135
|
+
// Then on completion:
|
|
136
|
+
renderToolCall('fs.read', args, 'success');
|
|
137
|
+
// Output: ✓
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Backward Compatibility
|
|
141
|
+
|
|
142
|
+
The entry point (`bin/agent.ts`) detects whether a subcommand was provided:
|
|
143
|
+
```typescript
|
|
144
|
+
const hasSubcommand = args.length > 0 && !args[0].startsWith('-');
|
|
145
|
+
if (hasSubcommand) {
|
|
146
|
+
program.parse(process.argv); // Traditional CLI
|
|
147
|
+
} else {
|
|
148
|
+
startREPL(); // Interactive mode
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 🚀 What's Next?
|
|
153
|
+
|
|
154
|
+
The interactive CLI opens up new possibilities:
|
|
155
|
+
- **Streaming responses** — Show LLM output character-by-character
|
|
156
|
+
- **Checkpointing** — Rewind codebase to a previous state within a session
|
|
157
|
+
- **Project Memory** — Automatic `.agent.md` files for project-specific context
|
|
158
|
+
- **Multi-agent mode** — Spawn sub-agents for parallel tasks within the REPL
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### 📚 Full Series
|
|
163
|
+
|
|
164
|
+
1. **Architecture & Vision**
|
|
165
|
+
2. **The Brain (Goal Decomposition)**
|
|
166
|
+
3. **The Body (Skill Execution)**
|
|
167
|
+
4. **The Memory (Persistence)**
|
|
168
|
+
5. **Self-Improvement (Auto-Fixer)**
|
|
169
|
+
6. **Plugin Ecosystem (Hooks, Commands, Multi-CLI)**
|
|
170
|
+
7. **Interactive CLI (This Article)**
|
|
171
|
+
|
|
172
|
+
Explore the source code at [GitHub](https://github.com/praveencs87/agent) or install with `npm i -g @praveencs/agent`.
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
# Comparison: @praveencs/agent vs OpenClaw
|
|
2
2
|
|
|
3
|
-
This document compares `@praveencs/agent` (this project) with [OpenClaw](https://github.com/openclaw/openclaw), a popular open-source AI operating system.
|
|
3
|
+
This document compares `@praveencs/agent` v0.8.0 (this project) with [OpenClaw](https://github.com/openclaw/openclaw), a popular open-source AI operating system.
|
|
4
4
|
|
|
5
5
|
## 1. Core Philosophy
|
|
6
6
|
|
|
7
7
|
| Feature | @praveencs/agent | OpenClaw |
|
|
8
8
|
|---|---|---|
|
|
9
9
|
| **Primary Goal** | **Autonomous Task Execution.** Designed to be a headless "digital employee" that plans and builds software in the background. | **AI Operating System.** Designed to be a "24/7 Jarvis" that integrates with chat apps (Discord, Telegram) and manages your digital life. |
|
|
10
|
-
| **Interaction** | **CLI-First.**
|
|
10
|
+
| **Interaction** | **CLI-First + Interactive REPL.** Subcommands for automation, plus a conversational mode with slash commands. | **Chat-First.** You talk to it via various messaging platforms. |
|
|
11
11
|
| **Persona** | A Junior Developer / Project Manager. | A Personal Assistant / OS Interface. |
|
|
12
12
|
|
|
13
13
|
## 2. Architecture
|
|
14
14
|
|
|
15
15
|
### @praveencs/agent
|
|
16
16
|
- **Monolithic CLI/Daemon**: A single TypeScript application that runs locally.
|
|
17
|
+
- **Interactive REPL**: Conversational mode with multi-turn context (v0.8.0).
|
|
17
18
|
- **Daemon Loop**: A background process that polls a queue of tasks.
|
|
18
19
|
- **Planner-Executor Split**: Explicit "Brain" (Goal Decomposition) and "Body" (Task Execution) separation.
|
|
20
|
+
- **Plugin System**: Extensible via hooks, commands, and plugin bundles (v0.8.0).
|
|
19
21
|
- **Database**: Uses `better-sqlite3` for high-performance, structured local storage.
|
|
20
22
|
|
|
21
23
|
### OpenClaw
|
|
@@ -27,11 +29,22 @@ This document compares `@praveencs/agent` (this project) with [OpenClaw](https:/
|
|
|
27
29
|
|
|
28
30
|
| | @praveencs/agent | OpenClaw |
|
|
29
31
|
|---|---|---|
|
|
30
|
-
| **Skill Definition** | **Prompt-as-Code.** Skills are
|
|
31
|
-
| **Execution** | **Shell-Native.** Executes command-line tools natively
|
|
32
|
+
| **Skill Definition** | **Prompt-as-Code.** Skills are `.md` files + Commands are lightweight goal templates. | **Plugin System.** Code-based plugins to extend functionality. |
|
|
33
|
+
| **Execution** | **Shell-Native + Multi-CLI.** Executes command-line tools natively AND delegates to Cursor/Codex/Gemini/Claude CLIs. | **Sandbox-Native.** Heavily focuses on browser automation and secure sandboxing. |
|
|
34
|
+
| **Extensibility** | **Hooks + Plugins.** Lifecycle hooks at every execution point, distributable plugin bundles. | **Plugin-based.** Extends via code plugins. |
|
|
32
35
|
| **Self-Improvement** | **Built-in Auto-Fixer.** Monitors success rates and rewrites broken skills automatically. | **Manual/Plugin.** Relies on users or plugin updates. |
|
|
33
36
|
|
|
34
|
-
## 4.
|
|
37
|
+
## 4. CLI Experience
|
|
38
|
+
|
|
39
|
+
| | @praveencs/agent v0.8.0 | OpenClaw |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| **Interactive Mode** | ✅ Conversational REPL with multi-turn context | ❌ Chat-app dependent |
|
|
42
|
+
| **Slash Commands** | ✅ `/help`, `/skills`, `/commands`, `/hooks`, `/model`, custom user commands | N/A |
|
|
43
|
+
| **Tab Completion** | ✅ Built-in autocomplete | N/A |
|
|
44
|
+
| **Lifecycle Hooks** | ✅ 10 event types with template variables | ❌ |
|
|
45
|
+
| **Multi-CLI Orchestration** | ✅ Cursor, Codex, Gemini, Claude wrappers | ❌ |
|
|
46
|
+
|
|
47
|
+
## 5. Memory Implementation
|
|
35
48
|
|
|
36
49
|
### @praveencs/agent
|
|
37
50
|
- **Hybrid Storage**: Uses **SQLite** for structured data (tasks, metrics) and **Vector/FTS5** layers for semantic search.
|
|
@@ -41,11 +54,13 @@ This document compares `@praveencs/agent` (this project) with [OpenClaw](https:/
|
|
|
41
54
|
- **File-System Storage**: Stores conversations and memories as Markdown files.
|
|
42
55
|
- **Why?**: "Unix philosophy" - easy to read/edit by humans, no database dependencies.
|
|
43
56
|
|
|
44
|
-
##
|
|
57
|
+
## 6. Use Case Recommendation
|
|
45
58
|
|
|
46
59
|
**Choose @praveencs/agent if:**
|
|
47
60
|
- You want an AI to **write code, manage servers, or automate dev workflows**.
|
|
48
|
-
- You
|
|
61
|
+
- You want an **interactive conversational CLI** experience.
|
|
62
|
+
- You need a **plugin ecosystem** to extend capabilities.
|
|
63
|
+
- You want to **orchestrate multiple AI CLIs** (Cursor, Claude, etc.).
|
|
49
64
|
- You need structured planning and long-term project management.
|
|
50
65
|
- You want a system that improves itself over time.
|
|
51
66
|
|
|
@@ -57,4 +72,4 @@ This document compares `@praveencs/agent` (this project) with [OpenClaw](https:/
|
|
|
57
72
|
|
|
58
73
|
## Summary
|
|
59
74
|
|
|
60
|
-
While OpenClaw builds a bridge between AI and *Communication Channels*, `@praveencs/agent` builds a bridge between AI and *Work Execution*.
|
|
75
|
+
While OpenClaw builds a bridge between AI and *Communication Channels*, `@praveencs/agent` builds a bridge between AI and *Work Execution*. With v0.8.0, we've added extensibility (plugins, hooks, commands) and a modern interactive CLI, making it the most developer-centric autonomous agent available.
|