@praveencs/agent 0.8.0 โ†’ 0.8.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,17 +1,51 @@
1
- # Agent Runtime
1
+ # ๐Ÿค– Agent Runtime
2
2
 
3
- An autonomous, goal-oriented AI agent runtime with persistent memory, skill execution, and self-improvement capabilities. The agent acts as your digital employee, capable of breaking down high-level objectives into actionable tasks, executing them using a variety of skills, and learning from its experiences.
3
+ > An autonomous, goal-oriented AI agent runtime with an interactive CLI, plugin ecosystem, and self-improvement capabilities.
4
4
 
5
- ---
5
+ [![npm version](https://img.shields.io/npm/v/@praveencs/agent)](https://www.npmjs.com/package/@praveencs/agent)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+
8
+ ```
9
+ $ agent
10
+
11
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
12
+ โ”‚ ๐Ÿค– Agent Runtime v0.8.1 โ”‚
13
+ โ”‚ Project: my-app โ”‚
14
+ โ”‚ Model: gpt-4o โ”‚ 3 skills โ”‚ 2 commands โ”‚
15
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
16
+
17
+ Type a goal, a /command, or /help for help.
6
18
 
7
- ## ๐Ÿš€ Features
19
+ > Refactor the auth module to use JWT
20
+ โ ‹ Thinking...
21
+ โšก fs.read(src/auth/handler.ts) โœ“
22
+ โšก fs.write(src/auth/jwt.ts) โœ“
23
+ โšก cmd.run(npm test) โœ“
8
24
 
9
- - **๐Ÿง  Goal Decomposition**: Uses LLM reasoning to break complex, high-level objectives into specific, actionable tasks.
10
- - **โšก Autonomous Execution**: Runs tasks in the background via a robust daemon process, respecting dependencies and priorities.
11
- - **๐Ÿ’พ Persistent Memory**: SQLite-based semantic memory with FTS5 search. Stores facts, project context, and learned patterns across sessions.
12
- - **๐Ÿ› ๏ธ Extensible Skill System**: Capabilities are defined by simple markdown prompts (`prompt.md`). Install skills from a hub or create your own.
13
- - **๐Ÿ“Š Reporting**: Generates daily standup reports and executive summaries of activity and progress.
14
- - **โค๏ธ Self-Improvement**: Tracks skill performance metrics and automatically attempts to patch/repair failing skills using the LLM.
25
+ โœ“ Done (12.3s)
26
+
27
+ > /deploy-staging
28
+ Running command: deploy-staging...
29
+ ```
30
+
31
+ ---
32
+
33
+ ## โœจ Features
34
+
35
+ | Category | Capabilities |
36
+ |----------|-------------|
37
+ | **๐Ÿค– Interactive CLI** | Conversational REPL with multi-turn context, slash commands, and tab completion |
38
+ | **๐Ÿง  Goal Decomposition** | LLM-powered breakdown of complex objectives into dependency-aware task graphs |
39
+ | **โšก Autonomous Execution** | Background daemon processes tasks with retries, rollback, and verification |
40
+ | **๐Ÿ› ๏ธ Extensible Skills** | Markdown-based skill definitionsโ€”install from a hub or write your own |
41
+ | **โšก Lightweight Commands** | Quick goal templates as markdown filesโ€”no boilerplate needed |
42
+ | **๐Ÿช Lifecycle Hooks** | Intercept execution at 10 event points (before:tool, after:plan, etc.) |
43
+ | **๐Ÿ”Œ Plugin System** | Bundle skills, commands, and hooks into distributable packages |
44
+ | **๐Ÿ”ง Multi-CLI Orchestration** | Delegate tasks to Cursor, Codex, Gemini, or Claude CLIs |
45
+ | **๐Ÿ’พ Persistent Memory** | SQLite + FTS5 semantic memory across sessions |
46
+ | **โค๏ธ Self-Improvement** | Monitors skill metrics and auto-patches failing skills |
47
+ | **๐Ÿ“Š Reporting** | Daily standup reports and AI-generated executive summaries |
48
+ | **๐Ÿ”’ Policy Engine** | Permission-gated tool execution with human-in-the-loop approval |
15
49
 
16
50
  ---
17
51
 
@@ -21,181 +55,444 @@ An autonomous, goal-oriented AI agent runtime with persistent memory, skill exec
21
55
  npm install -g @praveencs/agent
22
56
  ```
23
57
 
24
- ### Initial Configuration
25
- After installation, initialize the configuration:
58
+ ### Quick Start
59
+
60
+ ```bash
61
+ # Initialize project configuration
62
+ agent init
63
+
64
+ # Launch interactive mode (recommended)
65
+ agent
66
+
67
+ # Or run a one-off goal
68
+ agent run "Add input validation to the signup form"
69
+ ```
70
+
71
+ ### Configuration
72
+
73
+ After `agent init`, a `.agent/` directory is created in your project with configuration, skills, commands, and hooks. Set your LLM provider API keys:
26
74
 
27
75
  ```bash
76
+ # Set via environment variables
77
+ export OPENAI_API_KEY=sk-...
78
+ export ANTHROPIC_API_KEY=sk-ant-...
79
+
80
+ # Or configure directly
28
81
  agent config --init
29
82
  ```
30
83
 
31
- This will create a default configuration file (`~/.agent/config.json`) where you can set your LLM provider API keys (OpenAI, Anthropic, Azure, Ollama) and other preferences.
84
+ ---
85
+
86
+ ## ๐Ÿ“– Usage Guide
87
+
88
+ ### 1. Interactive Mode (Recommended)
89
+
90
+ Type `agent` with no arguments to enter the **Interactive REPL**:
91
+
92
+ ```bash
93
+ agent
94
+ ```
95
+
96
+ You get a bordered welcome banner showing your project, model, and loaded extensions. Then just type naturally:
97
+
98
+ ```
99
+ > Add rate limiting to the /api/auth endpoint
100
+ > Now write tests for it
101
+ > /deploy-staging
102
+ ```
103
+
104
+ The agent **remembers context** across turnsโ€”no need to repeat yourself.
105
+
106
+ #### Slash Commands
107
+
108
+ | Command | Action |
109
+ |---------|--------|
110
+ | `/help` | Show all available commands |
111
+ | `/skills` | List installed skills with status |
112
+ | `/commands` | List available lightweight commands |
113
+ | `/hooks` | Show registered lifecycle hooks |
114
+ | `/model` | Display current model and provider info |
115
+ | `/compact` | Summarize conversation and free context |
116
+ | `/clear` | Clear the terminal screen |
117
+ | `/exit` | Exit interactive mode |
118
+
119
+ Custom commands from `.agent/commands/` are also available as slash commands (e.g., `/deploy-staging`).
120
+
121
+ **Tab completion** works on all slash commandsโ€”press `Tab` after `/`.
32
122
 
33
123
  ---
34
124
 
35
- ## ๐Ÿ“– User Guide
125
+ ### 2. One-Shot Mode
36
126
 
37
- ### 1. The Workflow
38
- The typical workflow follows a **Plan โ†’ Decompose โ†’ Execute โ†’ Report** cycle:
127
+ Run a single goal without entering the REPL:
39
128
 
40
- 1. **Plan**: Tell the agent what you want to achieve.
41
- ```bash
42
- agent goal add "Create a personal blog with Next.js and PostgreSQL" --priority 1
43
- # Output: Goal #1 created
44
- ```
129
+ ```bash
130
+ agent run "Refactor the database module to use connection pooling"
131
+ agent run "Fix all TypeScript errors in the project"
132
+ agent run deploy-staging # Runs a named Command or Skill
133
+ ```
45
134
 
46
- 2. **Decompose**: Ask the agent to break it down.
47
- ```bash
48
- agent goal decompose 1
49
- # Output: Goal decomposed into 5 tasks (Scaffold, DB Setup, Styling...)
50
- ```
51
- *The agent uses its LLM planner to analyze the goal and your available skills to create a task list.*
135
+ ---
52
136
 
53
- 3. **Execute**: Start the daemon to work on tasks autonomously.
54
- ```bash
55
- agent daemon start
56
- ```
57
- *The daemon runs in the background, processing tasks, handling retries, and logging activity.*
137
+ ### 3. Skills
58
138
 
59
- You can check progress at any time:
60
- ```bash
61
- agent goal list # See goal status
62
- agent goal status 1 # See detailed task status for Goal #1
63
- agent daemon status # Check if the worker is running
64
- ```
139
+ Skills are reusable capabilities defined by markdown prompts and a `skill.json` manifest.
65
140
 
66
- 4. **Report**: Get a summary of what happened.
67
- ```bash
68
- agent report generate --summary
69
- ```
70
- *Generates a notification-style summary of completed work, new learnings, and any blockers.*
141
+ ```bash
142
+ # List installed skills
143
+ agent skills list
71
144
 
72
- ### 2. Managing Skills
73
- Skills are the tools your agent uses (e.g., `git-commit`, `docker-deploy`, `file-write`).
145
+ # Search the skill hub
146
+ agent skills search "docker"
74
147
 
75
- - **List installed skills**:
76
- ```bash
77
- agent skills list
78
- ```
148
+ # Install a skill
149
+ agent skills install <skill-name>
79
150
 
80
- - **Find new skills**:
81
- ```bash
82
- agent skills search "database"
83
- agent skills browse
84
- ```
151
+ # Create a custom skill
152
+ agent skills create my-new-skill
153
+ # โ†’ Creates .agent/skills/my-new-skill/prompt.md
85
154
 
86
- - **Install a skill**:
87
- ```bash
88
- agent skills install <skill-name>
89
- ```
155
+ # Self-healing
156
+ agent skills stats # View success rates
157
+ agent skills doctor my-skill # Diagnose failures
158
+ agent skills fix my-skill # Auto-repair with LLM
159
+ ```
90
160
 
91
- - **Create a custom skill**:
92
- ```bash
93
- agent skills create my-new-skill
94
- ```
95
- *This creates a template at `.agent/skills/my-new-skill/prompt.md`. Edit this file to define what the skill does using natural language instructions for the LLM.*
161
+ ---
96
162
 
97
- - **Self-Repair (Doctor)**:
98
- If a skill is failing, the agent can diagnose and fix it.
99
- ```bash
100
- agent skills stats # View success rates
101
- agent skills doctor my-skill # Analyze error logs
102
- agent skills fix my-skill # Attempt AI auto-repair
103
- ```
163
+ ### 4. Lightweight Commands
104
164
 
105
- ### 3. Memory & Context
106
- The agent automatically saves important information (like "Project uses Tailwind CSS") to its memory. You can search or manage this manually.
165
+ Commands are quick goal templatesโ€”just a markdown file. No `skill.json` needed.
107
166
 
108
- - **Search memory**:
109
- ```bash
110
- agent memory search "database credentials"
111
- ```
112
- - **Add a fact**:
113
- ```bash
114
- agent memory add "The staging server IP is 10.0.0.5" --category fact
115
- ```
167
+ Create `.agent/commands/deploy-staging.md`:
116
168
 
169
+ ```markdown
117
170
  ---
171
+ name: deploy-staging
172
+ description: Deploy current branch to staging
173
+ tools: [cmd.run, git.status, git.diff]
174
+ ---
175
+ # Deploy to Staging
118
176
 
119
- ## ๐Ÿค– CLI Command Reference
177
+ Steps:
178
+ 1. Run `npm test` to verify all tests pass
179
+ 2. Run `npm run build` to create the production bundle
180
+ 3. Run `git push origin HEAD:staging` to trigger deployment
181
+ ```
120
182
 
121
- ### General
122
- | Command | Description |
123
- |Str |---|
124
- | `agent run "<instruction>"` | Run a one-off instruction immediately |
125
- | `agent config --init` | Initialize configuration |
126
- | `agent doctor` | Check system health (dependencies, config) |
183
+ Now use it:
184
+
185
+ ```bash
186
+ agent run deploy-staging # From CLI
187
+ # or
188
+ > /deploy-staging # From interactive mode
189
+ ```
190
+
191
+ The command's markdown body becomes the LLM prompt, and only the whitelisted tools are available.
192
+
193
+ ```bash
194
+ agent commands list # See all available commands
195
+ ```
196
+
197
+ ---
198
+
199
+ ### 5. Lifecycle Hooks
200
+
201
+ Hooks intercept agent execution at every point. Define them in `.agent/hooks/hooks.json`:
202
+
203
+ ```json
204
+ {
205
+ "hooks": {
206
+ "after:tool": [
207
+ {
208
+ "match": "fs.write",
209
+ "command": "npx prettier --write {{path}}",
210
+ "blocking": false
211
+ }
212
+ ],
213
+ "before:plan": [
214
+ {
215
+ "command": "./scripts/validate-env.sh",
216
+ "blocking": true
217
+ }
218
+ ]
219
+ }
220
+ }
221
+ ```
222
+
223
+ #### Available Events
224
+
225
+ | Event | When |
226
+ |-------|------|
227
+ | `before:tool` / `after:tool` | Before/after any tool executes |
228
+ | `before:plan` / `after:plan` | Before/after a plan runs |
229
+ | `after:step` | After each plan step |
230
+ | `before:skill` / `after:skill` | Around skill execution |
231
+ | `after:decompose` | After goal decomposition |
232
+ | `session:start` / `session:end` | At session boundaries |
233
+
234
+ ```bash
235
+ agent hooks list # Show registered hooks
236
+ agent hooks add after:tool "npx eslint --fix {{path}}" --match fs.write
237
+ agent hooks events # Show all available events
238
+ ```
239
+
240
+ ---
241
+
242
+ ### 6. Plugins
243
+
244
+ Bundle skills, commands, and hooks into a distributable package:
245
+
246
+ ```
247
+ my-plugin/
248
+ โ”œโ”€โ”€ plugin.json
249
+ โ”œโ”€โ”€ skills/
250
+ โ”‚ โ””โ”€โ”€ security-scan/
251
+ โ”‚ โ”œโ”€โ”€ skill.json
252
+ โ”‚ โ””โ”€โ”€ prompt.md
253
+ โ”œโ”€โ”€ commands/
254
+ โ”‚ โ””โ”€โ”€ audit.md
255
+ โ””โ”€โ”€ hooks/
256
+ โ””โ”€โ”€ hooks.json
257
+ ```
258
+
259
+ `plugin.json`:
260
+ ```json
261
+ {
262
+ "name": "enterprise-security",
263
+ "version": "1.0.0",
264
+ "description": "Security scanning and compliance",
265
+ "skills": ["skills/"],
266
+ "commands": ["commands/"],
267
+ "hooks": "hooks/hooks.json"
268
+ }
269
+ ```
270
+
271
+ ```bash
272
+ agent plugins install ./my-plugin # Install from local path
273
+ agent plugins list # Show installed plugins
274
+ agent plugins remove my-plugin # Uninstall
275
+ ```
276
+
277
+ ---
278
+
279
+ ### 7. Multi-CLI Orchestration
280
+
281
+ The agent can delegate tasks to external AI CLIs when they're the right tool for the job:
282
+
283
+ | Tool | CLI | Best For |
284
+ |------|-----|----------|
285
+ | `cli.cursor` | Cursor | Multi-file refactoring with codebase context |
286
+ | `cli.codex` | OpenAI Codex | Code generation with sandbox execution |
287
+ | `cli.gemini` | Gemini | Large-context analysis and reasoning |
288
+ | `cli.claude` | Claude | Careful code review and generation |
289
+
290
+ Configure in `.agent/config.json`:
291
+ ```json
292
+ {
293
+ "cliTools": {
294
+ "cursor": { "binary": "cursor", "available": true },
295
+ "claude": { "binary": "claude", "available": true }
296
+ }
297
+ }
298
+ ```
299
+
300
+ The LLM orchestrator automatically selects the right CLI based on the task.
301
+
302
+ ---
303
+
304
+ ### 8. Goal Management & Daemon
305
+
306
+ For long-running, multi-step projects:
307
+
308
+ ```bash
309
+ # Create a goal
310
+ agent goal add "Build authentication with OAuth2" --priority 1
311
+
312
+ # AI decomposes into tasks
313
+ agent goal decompose 1
314
+
315
+ # Run tasks autonomously
316
+ agent daemon start
317
+
318
+ # Monitor progress
319
+ agent goal list # See goal status
320
+ agent goal status 1 # Detailed task view
321
+ agent daemon status # Daemon health
322
+ agent daemon logs # Recent execution logs
323
+
324
+ # Get reports
325
+ agent report generate --summary
326
+ ```
327
+
328
+ ---
329
+
330
+ ### 9. Plans
331
+
332
+ Create and run structured execution plans:
333
+
334
+ ```bash
335
+ agent plan propose "Migrate database from MySQL to PostgreSQL"
336
+ agent plan list
337
+ agent plan run <plan-file>
338
+ ```
339
+
340
+ ---
341
+
342
+ ### 10. Memory
343
+
344
+ The agent stores facts, learnings, and project context persistently:
345
+
346
+ ```bash
347
+ agent memory search "database credentials"
348
+ agent memory add "Staging server is at 10.0.0.5" --category fact
349
+ ```
350
+
351
+ ---
352
+
353
+ ## ๐Ÿค– Full CLI Reference
354
+
355
+ ### Core
127
356
 
128
- ### Goal Management
129
- | Command | Description |
130
- |---|---|
131
- | `agent goal add "<title>"` | Create a new high-level goal |
132
- | `agent goal list` | List all active goals |
133
- | `agent goal decompose <id>` | AI-power breakdown of a goal into tasks |
134
- | `agent goal status <id>` | View tasks and progress for a goal |
135
- | `agent goal task <id> "<title>"` | Manually add a task to a goal |
136
- | `agent goal run` | Manually run pending tasks (if daemon is off) |
137
-
138
- ### Daemon (Background Service)
139
357
  | Command | Description |
140
- |---|---|
141
- | `agent daemon start` | Start the background worker |
142
- | `agent daemon stop` | Stop the background worker |
143
- | `agent daemon status` | View daemon health and uptime |
144
- | `agent daemon logs` | View recent execution logs |
358
+ |---------|-------------|
359
+ | `agent` | Launch interactive REPL (no subcommand) |
360
+ | `agent run "<goal>"` | One-shot goal execution |
361
+ | `agent init` | Initialize project configuration |
362
+ | `agent config --init` | Set up global config |
363
+ | `agent doctor` | System health check |
145
364
 
146
365
  ### Skills
366
+
147
367
  | Command | Description |
148
- |---|---|
368
+ |---------|-------------|
149
369
  | `agent skills list` | List installed skills |
150
370
  | `agent skills search <query>` | Search the skill hub |
151
- | `agent skills install <name>` | Install a skill from hub or path |
371
+ | `agent skills install <name>` | Install a skill |
372
+ | `agent skills create <name>` | Create a custom skill |
152
373
  | `agent skills stats` | View performance metrics |
153
374
  | `agent skills doctor <name>` | Diagnose a failing skill |
154
- | `agent skills fix <name>` | Auto-fix a broken skill |
375
+ | `agent skills fix <name>` | Auto-repair with LLM |
376
+
377
+ ### Commands
155
378
 
156
- ### Reports
157
379
  | Command | Description |
158
- |---|---|
159
- | `agent report generate` | Generate today's activity report |
160
- | `agent report generate --summary` | Generate an AI executive summary |
380
+ |---------|-------------|
381
+ | `agent commands list` | List available commands |
161
382
 
162
- ---
383
+ ### Hooks
384
+
385
+ | Command | Description |
386
+ |---------|-------------|
387
+ | `agent hooks list` | Show registered hooks |
388
+ | `agent hooks add <event> <cmd>` | Add a new hook |
389
+ | `agent hooks events` | Show all hook events |
390
+
391
+ ### Plugins
163
392
 
164
- ## ๐Ÿ› ๏ธ Architecture
393
+ | Command | Description |
394
+ |---------|-------------|
395
+ | `agent plugins list` | List installed plugins |
396
+ | `agent plugins install <path>` | Install from local path |
397
+ | `agent plugins remove <name>` | Remove a plugin |
398
+
399
+ ### Goals & Daemon
165
400
 
166
- The runtime consists of several modular components:
401
+ | Command | Description |
402
+ |---------|-------------|
403
+ | `agent goal add "<title>"` | Create a goal |
404
+ | `agent goal list` | List goals |
405
+ | `agent goal decompose <id>` | AI breakdown |
406
+ | `agent goal status <id>` | Task-level progress |
407
+ | `agent daemon start` | Start background worker |
408
+ | `agent daemon stop` | Stop background worker |
409
+ | `agent daemon status` | Health & uptime |
167
410
 
168
- 1. **Orchestrator (CLI)**: Entry point for user interaction.
169
- 2. **Goal Manager**: State machine for tracking objectives (`Active`, `Completed`, `Failed`).
170
- 3. **Planner (Decomposer)**: LLM-based engine that breaks goals into dependency-aware tasks.
171
- 4. **Executor**: The engine that runs tasks. It matches tasks to skills and executes them securely.
172
- 5. **Memory Store**: Semantic storage using SQLite vector/FTS.
173
- 6. **Auto-Fixer Loop**: A meta-level process that monitors execution metrics and patches skills that drift or break.
411
+ ### Plans, Memory & Reports
412
+
413
+ | Command | Description |
414
+ |---------|-------------|
415
+ | `agent plan propose "<desc>"` | AI-generate a plan |
416
+ | `agent plan run <file>` | Execute a plan |
417
+ | `agent memory search <query>` | Search agent memory |
418
+ | `agent memory add "<fact>"` | Store a fact |
419
+ | `agent report generate` | Activity report |
174
420
 
175
421
  ---
176
422
 
423
+ ## ๐Ÿ—๏ธ Architecture
177
424
 
178
- ## ๐Ÿ“š Learning Series
425
+ ```
426
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
427
+ โ”‚ CLI / REPL โ”‚
428
+ โ”‚ agent run โ”‚ agent (REPL) โ”‚ /slash-commands โ”‚ MCP โ”‚
429
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
430
+ โ”‚ LLM Router โ”‚
431
+ โ”‚ OpenAI โ”‚ Anthropic โ”‚ Azure โ”‚ Ollama (fallback) โ”‚
432
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
433
+ โ”‚ Skills โ”‚ Commands โ”‚ Hooks โ”‚ Plugins โ”‚
434
+ โ”‚ .md โ”‚ .md โ”‚ .json โ”‚ bundles โ”‚
435
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
436
+ โ”‚ Tool Registry & Policy Engine โ”‚
437
+ โ”‚ fs.* โ”‚ cmd.run โ”‚ git.* โ”‚ cli.* โ”‚ project.detect โ”‚
438
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
439
+ โ”‚ Planner โ”‚ Executor โ”‚ Memory โ”‚ Daemon โ”‚ Reporter โ”‚
440
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
441
+ ```
179
442
 
180
- Want to understand how this agent works under the hood? Check out our 5-part architecture series:
443
+ **Key Components:**
444
+ - **CLI / REPL**: Entry pointโ€”interactive or subcommand-based
445
+ - **LLM Router**: Multi-provider with offline-first support and fallback chains
446
+ - **Skills**: Markdown prompt-based capabilities
447
+ - **Commands**: Lightweight goal templates (YAML frontmatter + prompt)
448
+ - **Hooks**: Event-driven lifecycle interception
449
+ - **Plugins**: Distributable bundles of skills + commands + hooks
450
+ - **Tool Registry**: Sandboxed tool execution with permission gates
451
+ - **Policy Engine**: Human-in-the-loop approval for sensitive operations
452
+ - **Multi-CLI Tools**: Cursor, Codex, Gemini, Claude wrappers
181
453
 
182
- 1. [**Vision & Architecture**](docs/articles/01-vision-architecture.md) - The high-level design.
183
- 2. [**The Brain (Planner)**](docs/articles/02-goal-decomposition.md) - How goal decomposition works.
184
- 3. [**The Body (Executor)**](docs/articles/03-skill-execution.md) - Secure skill execution.
185
- 4. [**Memory & Context**](docs/articles/04-memory-persistence.md) - SQLite & Vector storage.
186
- 5. [**Self-Improvement**](docs/articles/05-self-improvement.md) - Metrics & The Auto-Fixer.
454
+ ---
455
+
456
+ ## ๐Ÿ“š Learning Series
187
457
 
188
- ## ๐Ÿ”ฎ What's Next?
458
+ Understand the agent architecture with our 7-part deep-dive:
189
459
 
190
- We are just getting started. The future includes **Multi-Agent Swarms**, **Sandboxed Execution**, and **Voice Interfaces**.
191
- Check out our detailed [**ROADMAP.md**](ROADMAP.md) to see where we are heading and how you can help build the future of autonomous software development.
460
+ 1. [**Vision & Architecture**](docs/articles/01-vision-architecture.md) โ€” The high-level design
461
+ 2. [**The Brain (Planner)**](docs/articles/02-goal-decomposition.md) โ€” Goal decomposition
462
+ 3. [**The Body (Executor)**](docs/articles/03-skill-execution.md) โ€” Secure skill execution
463
+ 4. [**Memory & Context**](docs/articles/04-memory-persistence.md) โ€” SQLite & semantic search
464
+ 5. [**Self-Improvement**](docs/articles/05-self-improvement.md) โ€” Metrics & the Auto-Fixer
465
+ 6. [**Plugin Ecosystem**](docs/articles/06-plugin-ecosystem.md) โ€” Hooks, commands, multi-CLI
466
+ 7. [**Interactive CLI**](docs/articles/07-interactive-cli.md) โ€” The conversational experience
192
467
 
193
468
  ### Comparisons
194
- - [**vs OpenClaw**](docs/comparisons/openclaw.md) - How we differ from other AI OS projects.
469
+ - [**vs OpenClaw**](docs/comparisons/openclaw.md) โ€” How we differ from AI OS projects
470
+
471
+ ---
472
+
473
+ ## ๐Ÿ”ฎ Roadmap
474
+
475
+ Check out our detailed [**ROADMAP.md**](ROADMAP.md) to see what's next:
476
+ - โœ… **Phase 5**: Plugin Ecosystem & Extensibility
477
+ - โœ… **Phase 6**: Interactive CLI Experience
478
+ - ๐Ÿ”œ **Phase 1**: Sandboxed Execution & Secrets Management
479
+ - ๐Ÿ”œ **Phase 2**: Multi-Agent Collaboration (The Swarm)
480
+ - ๐Ÿ”œ **Phase 3**: Voice & Vision Interfaces
481
+ - ๐Ÿ”œ **Phase 4**: The Agent Cloud (Skill Hub, Remote Execution, Dashboard)
482
+
483
+ ---
195
484
 
196
485
  ## ๐Ÿค Contributing
197
486
 
198
- We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to set up your development environment.
487
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
488
+
489
+ Key areas where we need help:
490
+ - Writing new Skills
491
+ - Improving Planner prompt engineering
492
+ - Building the Web Dashboard
493
+ - Creating community Plugins
494
+
495
+ ---
199
496
 
200
497
  ## License
201
498
 
@@ -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 5-part series, we will break down exactly how we built `@praveencs/agent`, a powerful, open-source autonomous agent runtime.
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
- ## ๐Ÿš€ Conclusion
69
+ ## ๐Ÿš€ But Wait, There's More
70
70
 
71
- We have built a system that:
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
- This loopโ€”Plan, Do, Check, Actโ€”is the foundation of autonomy.
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.** You give it a goal, and it works silently. | **Chat-First.** You talk to it via various messaging platforms. |
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 simple `.md` files with natural language instructions. | **Plugin System.** Code-based plugins to extend functionality. |
31
- | **Execution** | **Shell-Native.** Executes command-line tools natively (git, docker, npm). | **Sandbox-Native.** Heavily focuses on browser automation and secure sandboxing. |
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. Memory Implementation
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
- ## 5. Use Case Recommendation
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 prefer a command-line interface.
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*. We are focused on the "Agent as a Worker" paradigm, whereas OpenClaw focuses on "Agent as an Interface".
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praveencs/agent",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "bin",