agdi 2.4.0 โ†’ 2.4.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.
Files changed (3) hide show
  1. package/README.md +321 -93
  2. package/dist/index.js +466 -105
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,150 +1,378 @@
1
- # agdi ๐Ÿš€
1
+ <div align="center">
2
2
 
3
- **The AI-powered app generator** - Build full-stack applications from natural language in your terminal.
3
+ ```
4
+ ___ __ _
5
+ / | ____ _____/ /(_)
6
+ / /| | / __ `/ __ // /
7
+ / ___ |/ /_/ / /_/ // /
8
+ /_/ |_|\_, /\__,_//_/
9
+ /____/
10
+ ```
11
+
12
+ # agdi
13
+
14
+ ### The AI-Powered Coding Assistant for Your Terminal
15
+
16
+ [![npm version](https://img.shields.io/npm/v/agdi?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/agdi)
17
+ [![npm downloads](https://img.shields.io/npm/dw/agdi?style=for-the-badge&logo=npm&logoColor=white&color=4FC08D)](https://www.npmjs.com/package/agdi)
18
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
19
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/)
20
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.4-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
4
21
 
5
- [![npm version](https://img.shields.io/npm/v/agdi.svg)](https://www.npmjs.com/package/agdi)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
22
+ **Build full-stack apps from natural language โ€ข AI-powered Git workflow โ€ข Enterprise-grade security**
7
23
 
8
- ## Installation
24
+ [Website](https://agdi-dev.vercel.app) ยท [npm](https://www.npmjs.com/package/agdi) ยท [GitHub](https://github.com/anassagd432/Agdi-dev)
25
+
26
+ </div>
27
+
28
+ ---
29
+
30
+ ## โšก Quick Start
9
31
 
10
32
  ```bash
33
+ # Install globally
11
34
  npm install -g agdi
35
+
36
+ # Start coding
37
+ agdi
12
38
  ```
13
39
 
14
- Or run directly with npx:
15
- ```bash
16
- npx agdi init
40
+ That's it. Agdi handles the rest.
41
+
42
+ ---
43
+
44
+ ## ๐ŸŽฌ Demo
45
+
17
46
  ```
47
+ $ agdi
18
48
 
19
- ## Quick Start
49
+ โšก Agdi dev
20
50
 
21
- ```bash
22
- # Interactive mode (recommended)
23
- agdi init
51
+ Model: gemini-2.5-flash
52
+ Workspace: ~/projects/my-app
53
+ Commands: /status, /diff, /commit, /build, /clear, /history, /model, /help, /exit
24
54
 
25
- # Generate from prompt
26
- agdi generate "Create a todo app with dark mode"
55
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
27
56
 
28
- # Interactive coding session
29
- agdi chat
57
+ โ†’ create a todo app with dark mode and local storage
30
58
 
31
- # Configure API keys
32
- agdi auth
59
+ Generating action plan...
60
+
61
+ ๐Ÿ“‹ Action Plan - todo-app
62
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
63
+ โœ“ mkdir src
64
+ โœ“ writeFile package.json
65
+ โœ“ writeFile src/App.tsx
66
+ โœ“ writeFile src/index.css
67
+ โœ“ exec pnpm install
68
+
69
+ โœ… Project created! Run: cd todo-app && pnpm dev
33
70
  ```
34
71
 
35
- ## Features
72
+ ---
73
+
74
+ ## โœจ Features
36
75
 
37
- - ๐Ÿ†“ **FREE AI Access** - No API key required (powered by Puter.com)
38
- - ๐Ÿค– **400+ AI Models** - GPT-5, Claude 4.5, Gemini 3, Llama 4, and more
39
- - โšก **Instant Generation** - Full React/Vite apps in seconds
40
- - ๐Ÿ’ฌ **Interactive Mode** - Chat-based coding assistant
41
- - ๐Ÿ”‘ **Bring Your Own Key** - Use your own OpenAI, Anthropic, or Gemini keys
42
- - ๐Ÿ”’ **Enterprise Security** - Permission gate, audit logging, workspace trust
76
+ <table>
77
+ <tr>
78
+ <td width="50%">
43
79
 
44
- ## Security Architecture
80
+ ### ๐Ÿค– AI-Powered Development
81
+ - **Natural language to code** โ€” Describe what you want, get production-ready apps
82
+ - **Conversation memory** โ€” AI remembers context across messages
83
+ - **Multi-turn chat** โ€” Iterative development with full context
45
84
 
46
- Agdi includes a comprehensive security system for safe command execution:
85
+ </td>
86
+ <td width="50%">
47
87
 
48
- ### Permission Gate
88
+ ### ๐Ÿ”ง Built-in Git Integration
89
+ - `/status` โ€” AI analysis of your repo state
90
+ - `/diff` โ€” Smart explanation of your changes
91
+ - `/commit` โ€” Auto-generated conventional commits
49
92
 
50
- All commands pass through a single gatekeeper with 4-tier risk classification:
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td width="50%">
51
97
 
52
- | Tier | Description | Examples |
53
- |------|-------------|----------|
54
- | **0** | Read-only | `ls`, `cat`, `git status` |
55
- | **1** | Workspace write | `touch`, `mkdir`, `git commit` |
56
- | **2** | System/package | `npm install`, `docker run` |
57
- | **3** | Dangerous | `sudo`, `rm -rf`, `curl \| bash` |
98
+ ### ๐Ÿ›ก๏ธ Enterprise Security
99
+ - **Permission Gate** โ€” 4-tier command risk classification
100
+ - **Workspace Trust** โ€” Per-directory security boundaries
101
+ - **Code Firewall** โ€” Real-time secret/injection scanning
102
+ - **Audit Logging** โ€” OWASP-aligned decision logs
58
103
 
59
- ### Approval Options
104
+ </td>
105
+ <td width="50%">
60
106
 
61
- When prompted for permission:
62
- - **[A] Approve once** - Allow this single execution
63
- - **[S] Approve for session** - Allow for current session
64
- - **[+] Always allow** - Save rule to allow permanently
65
- - **[?] Always prompt** - Save rule to always ask
66
- - **[-] Always forbid** - Save rule to always block
67
- - **[D] Deny** - Block this execution
107
+ ### ๐ŸŒ Multi-Provider AI
108
+ - **Gemini** โ€” Free tier, fast responses
109
+ - **OpenRouter** โ€” 400+ models, one API
110
+ - **OpenAI** โ€” GPT-4o, o1 reasoning
111
+ - **Anthropic** โ€” Claude 3.5 Sonnet
112
+ - **DeepSeek** โ€” R1, V3 models
68
113
 
69
- ### Workspace Trust
114
+ </td>
115
+ </tr>
116
+ </table>
70
117
 
71
- On first run, you'll be prompted to trust the workspace:
72
- - **Trust for session** - Allow commands for this session only
73
- - **Trust and remember** - Permanently trust this workspace
74
- - **Exit** - Don't grant trust, exit immediately
118
+ ---
75
119
 
76
- Untrusted workspaces are restricted to Tier 0 (read-only) commands.
120
+ ## ๐Ÿ“‹ Commands Reference
77
121
 
78
- ### Audit Logging
122
+ ### Interactive Mode (Default)
79
123
 
80
- All permission decisions are logged to `~/.agdi/audit.jsonl` in OWASP-aligned format.
124
+ ```bash
125
+ agdi # Start interactive coding session
126
+ ```
81
127
 
82
- ## Commands
128
+ Inside the session:
83
129
 
84
130
  | Command | Description |
85
131
  |---------|-------------|
86
- | `agdi init` | Interactive project creation wizard |
87
- | `agdi generate <prompt>` | Generate app from prompt |
88
- | `agdi chat` | Start interactive coding session |
89
- | `agdi auth` | Configure API keys |
90
- | `agdi models` | List available AI models |
91
- | `agdi --help` | Show all commands |
92
-
93
- ## Examples
132
+ | `/build <prompt>` | Generate & execute an app from description |
133
+ | `/edit <file>` | AI-powered surgical file editing |
134
+ | `/status` | AI analysis of git status |
135
+ | `/diff` | AI explanation of current changes |
136
+ | `/commit` | Auto-generate & run git commit |
137
+ | `/clear` | Clear conversation history |
138
+ | `/history` | Show recent conversation |
139
+ | `/model` | Change AI model |
140
+ | `/help` | Show all commands |
141
+ | `/exit` | Exit Agdi |
142
+
143
+ ### Direct Commands
94
144
 
95
145
  ```bash
96
- # Create a dashboard
97
- agdi generate "Build an analytics dashboard with charts"
146
+ agdi build "todo app" # Generate app directly
147
+ agdi chat # Simple chat mode
148
+ agdi auth # Configure API keys
149
+ agdi model # Change AI model
150
+ agdi config # Show configuration
151
+ agdi run [dir] # Run a generated project
152
+ ```
153
+
154
+ ---
155
+
156
+ ## ๐Ÿ›ก๏ธ Security Architecture
157
+
158
+ Agdi includes **zero-trust security** designed for safe AI-assisted development:
159
+
160
+ ### ๐Ÿšฆ Permission Gate
98
161
 
99
- # Create an e-commerce store
100
- agdi generate "Create a product catalog with shopping cart" -m claude-sonnet-4-5
162
+ Every command is classified by risk level:
101
163
 
102
- # Use specific model
103
- agdi generate "Build a blog" -p puter -m gpt-5
104
164
  ```
165
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
166
+ โ”‚ Tier โ”‚ Risk Level โ”‚ Examples โ”‚ Default โ”‚
167
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
168
+ โ”‚ 0 โ”‚ Read-only โ”‚ ls, cat, git status โ”‚ Auto-approve โ”‚
169
+ โ”‚ 1 โ”‚ Workspace โ”‚ touch, mkdir, git commit โ”‚ Prompt once โ”‚
170
+ โ”‚ 2 โ”‚ System โ”‚ npm install, docker run โ”‚ Always promptโ”‚
171
+ โ”‚ 3 โ”‚ Dangerous โ”‚ sudo, rm -rf, curl|bash โ”‚ Block โ”‚
172
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
173
+ ```
174
+
175
+ ### ๐Ÿ” Approval Options
176
+
177
+ When prompted:
178
+ - **[A]** Approve once
179
+ - **[S]** Approve for session
180
+ - **[+]** Always allow (saved rule)
181
+ - **[?]** Always prompt (saved rule)
182
+ - **[-]** Always forbid (saved rule)
183
+ - **[D]** Deny
184
+
185
+ ### ๐Ÿข Workspace Trust
186
+
187
+ First run in any directory triggers trust verification:
188
+ - Trust for session only
189
+ - Trust and remember permanently
190
+ - Exit without trust (read-only mode)
105
191
 
106
- ## Supported Models
192
+ ### ๐Ÿ”ฅ Code Firewall
107
193
 
108
- ### Free (No API Key)
109
- - GPT-5, GPT-5 Mini
110
- - Claude 4.5 Sonnet, Claude 4.5 Opus
111
- - Gemini 3 Pro, Gemini 2.5 Flash
112
- - Llama 4, DeepSeek R1, Grok 3
194
+ Real-time scanning detects:
195
+ - **22+ secret patterns** โ€” AWS, GitHub, OpenAI, Anthropic, Stripe, etc.
196
+ - **Shell injection** โ€” Dangerous command patterns
197
+ - **Prompt injection** โ€” LLM manipulation attempts
198
+ - **Supply chain risks** โ€” Suspicious package references
199
+
200
+ ### ๐Ÿ“Š Audit Logging
201
+
202
+ All decisions logged to `~/.agdi/audit.jsonl`:
203
+
204
+ ```json
205
+ {"ts":"2026-01-22T00:30:00Z","action":"approve","tier":1,"cmd":"git commit","reason":"session"}
206
+ ```
207
+
208
+ ---
209
+
210
+ ## ๐Ÿค– Supported Models
113
211
 
114
212
  ### Bring Your Own Key
115
- - OpenAI (GPT-5, o3-mini)
116
- - Anthropic (Claude 4.5)
117
- - Google (Gemini 3)
118
- - DeepSeek, Mistral, and more
119
213
 
120
- ## Configuration
214
+ <table>
215
+ <tr>
216
+ <td>
217
+
218
+ **Google Gemini** ๐Ÿ”ฅ
219
+ - Gemini 2.5 Flash โšก
220
+ - Gemini 2.5 Pro ๐Ÿš€
221
+ - Gemini 2.0 Flash
222
+
223
+ </td>
224
+ <td>
225
+
226
+ **OpenRouter** ๐ŸŒ
227
+ - Claude 3.5 Sonnet
228
+ - GPT-4o / 4o Mini
229
+ - Llama 3.3 70B
230
+ - DeepSeek R1
231
+ - 400+ more
232
+
233
+ </td>
234
+ <td>
235
+
236
+ **OpenAI** ๐Ÿง 
237
+ - GPT-4o
238
+ - GPT-4o Mini
239
+ - o1
240
+ - o1-mini
241
+
242
+ </td>
243
+ </tr>
244
+ <tr>
245
+ <td>
246
+
247
+ **Anthropic** ๐Ÿ’œ
248
+ - Claude 3.5 Sonnet
249
+ - Claude 3.5 Haiku
250
+ - Claude 3 Opus
121
251
 
122
- API keys and rules are stored in `~/.agdi/`:
252
+ </td>
253
+ <td>
254
+
255
+ **DeepSeek** ๐ŸŒŠ
256
+ - DeepSeek V3
257
+ - DeepSeek R1 (Reasoning)
258
+
259
+ </td>
260
+ <td>
261
+
262
+ **Get Keys** ๐Ÿ”‘
263
+ - [Gemini](https://aistudio.google.com/apikey)
264
+ - [OpenRouter](https://openrouter.ai/keys)
265
+ - [OpenAI](https://platform.openai.com/api-keys)
266
+ - [Anthropic](https://console.anthropic.com/)
267
+ - [DeepSeek](https://platform.deepseek.com/)
268
+
269
+ </td>
270
+ </tr>
271
+ </table>
272
+
273
+ ---
274
+
275
+ ## โš™๏ธ Configuration
276
+
277
+ Config stored in `~/.agdi/`:
123
278
 
124
279
  ```
125
280
  ~/.agdi/
126
- โ”œโ”€โ”€ config.json # API keys and settings
127
- โ”œโ”€โ”€ rules.json # Permission rules
128
- โ”œโ”€โ”€ trusted-workspaces.json # Trusted workspaces
129
- โ””โ”€โ”€ audit.jsonl # Audit log
281
+ โ”œโ”€โ”€ config.json # API keys & settings
282
+ โ”œโ”€โ”€ rules.json # Permission rules
283
+ โ”œโ”€โ”€ trusted-workspaces.json # Trusted directories
284
+ โ””โ”€โ”€ audit.jsonl # Audit log
130
285
  ```
131
286
 
132
287
  ```bash
133
- agdi auth # Interactive setup
134
- agdi auth --status # Show current config
288
+ # Interactive setup
289
+ agdi auth
290
+
291
+ # Show config
292
+ agdi config
293
+
294
+ # Check auth status
295
+ agdi auth --status
296
+ ```
297
+
298
+ ---
299
+
300
+ ## ๐Ÿ“Š Quality Metrics
301
+
302
+ <table>
303
+ <tr>
304
+ <td align="center">
305
+ <h3>0</h3>
306
+ <p>TypeScript Errors</p>
307
+ </td>
308
+ <td align="center">
309
+ <h3>100</h3>
310
+ <p>Tests Passing</p>
311
+ </td>
312
+ <td align="center">
313
+ <h3>22+</h3>
314
+ <p>Security Patterns</p>
315
+ </td>
316
+ <td align="center">
317
+ <h3>900+</h3>
318
+ <p>Weekly Downloads</p>
319
+ </td>
320
+ </tr>
321
+ </table>
322
+
323
+ ---
324
+
325
+ ## ๐Ÿš€ Examples
326
+
327
+ ```bash
328
+ # Create a full-stack app
329
+ agdi build "Create a blog with authentication and markdown support"
330
+
331
+ # Create a dashboard
332
+ agdi build "Build an analytics dashboard with charts using Recharts"
333
+
334
+ # Create an API
335
+ agdi build "Create a REST API with Express, Prisma, and PostgreSQL"
336
+
337
+ # Interactive development
338
+ agdi
339
+ โ†’ Help me debug this React component
340
+ โ†’ Add dark mode to my app
341
+ โ†’ Explain this TypeScript error
135
342
  ```
136
343
 
137
- ## Requirements
344
+ ---
345
+
346
+ ## ๐Ÿ“ฆ Tech Stack
347
+
348
+ - **Runtime**: Node.js 18+
349
+ - **Language**: TypeScript 5.4
350
+ - **CLI Framework**: Commander.js
351
+ - **Prompts**: Inquirer
352
+ - **Styling**: Chalk, Ora
353
+ - **Build**: tsup
354
+ - **Testing**: Vitest
355
+
356
+ ---
357
+
358
+ ## ๐Ÿ”— Links
359
+
360
+ - ๐ŸŒ **Website**: [agdi-dev.vercel.app](https://agdi-dev.vercel.app)
361
+ - ๐Ÿ“ฆ **npm**: [npmjs.com/package/agdi](https://www.npmjs.com/package/agdi)
362
+ - ๐Ÿ™ **GitHub**: [github.com/anassagd432/Agdi-dev](https://github.com/anassagd432/Agdi-dev)
363
+
364
+ ---
365
+
366
+ ## ๐Ÿ“„ License
367
+
368
+ MIT ยฉ [Agdi Systems Inc.](https://agdi-dev.vercel.app)
138
369
 
139
- - Node.js 18 or higher
140
- - npm or yarn
370
+ ---
141
371
 
142
- ## Links
372
+ <div align="center">
143
373
 
144
- - ๐ŸŒ [Website](https://agdi.dev)
145
- - ๐Ÿ“– [Documentation](https://docs.agdi.dev)
146
- - ๐Ÿ™ [GitHub](https://github.com/agdi-dev/agdi)
374
+ **Built with โค๏ธ by [Anass Agdi](https://github.com/anassagd432)**
147
375
 
148
- ## License
376
+ โญ **Star on GitHub** if you find this useful!
149
377
 
150
- MIT ยฉ [Agdi Systems Inc.](https://agdi.dev)
378
+ </div>