agdi 2.4.0 โ†’ 2.5.0

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 +340 -93
  2. package/dist/index.js +587 -108
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,150 +1,397 @@
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
+ ---
36
73
 
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
74
+ ## โœจ Features
43
75
 
44
- ## Security Architecture
76
+ <table>
77
+ <tr>
78
+ <td width="50%">
45
79
 
46
- Agdi includes a comprehensive security system for safe command execution:
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
47
84
 
48
- ### Permission Gate
85
+ </td>
86
+ <td width="50%">
49
87
 
50
- All commands pass through a single gatekeeper with 4-tier risk classification:
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
51
92
 
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` |
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td width="50%">
58
97
 
59
- ### Approval Options
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
60
103
 
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
104
+ </td>
105
+ <td width="50%">
68
106
 
69
- ### Workspace Trust
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
70
113
 
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
114
+ </td>
115
+ </tr>
116
+ </table>
75
117
 
76
- Untrusted workspaces are restricted to Tier 0 (read-only) commands.
118
+ ---
77
119
 
78
- ### Audit Logging
120
+ ## ๐Ÿ“‹ Commands Reference
79
121
 
80
- All permission decisions are logged to `~/.agdi/audit.jsonl` in OWASP-aligned format.
122
+ ### Interactive Mode (Default)
123
+
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
161
+
162
+ Every command is classified by risk level:
163
+
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)
191
+
192
+ ### ๐Ÿ”ฅ Code Firewall
193
+
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
98
201
 
99
- # Create an e-commerce store
100
- agdi generate "Create a product catalog with shopping cart" -m claude-sonnet-4-5
202
+ All decisions logged to `~/.agdi/audit.jsonl`:
101
203
 
102
- # Use specific model
103
- agdi generate "Build a blog" -p puter -m gpt-5
204
+ ```json
205
+ {"ts":"2026-01-22T00:30:00Z","action":"approve","tier":1,"cmd":"git commit","reason":"session"}
104
206
  ```
105
207
 
106
- ## Supported Models
208
+ ---
107
209
 
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
210
+ ## ๐Ÿค– Supported Models
211
+
212
+ ### Free Models (OpenRouter - No Credits Needed)
213
+
214
+ | Model | ID | Best For |
215
+ |-------|-----|----------|
216
+ | GPT-OSS 120B | `openai/gpt-oss-120b:free` | General coding |
217
+ | GPT-OSS 20B | `openai/gpt-oss-20b:free` | Fast responses |
218
+ | Qwen3 Coder | `qwen/qwen3-coder:free` | Code generation |
219
+ | Qwen3 Next 80B | `qwen/qwen3-next-80b-a3b-instruct:free` | Complex tasks |
220
+ | Kimi K2 | `moonshotai/kimi-k2:free` | General purpose |
221
+ | Gemma 3N E2B | `google/gemma-3n-e2b-it:free` | Lightweight |
222
+ | LFM Thinking | `liquid/lfm-2.5-1.2b-thinking:free` | Agentic tasks |
223
+ | Devstral โš ๏ธ | `mistralai/devstral-2512:free` | Ends Jan 27 |
224
+
225
+ ### Image Generation
226
+
227
+ | Model | ID | Description |
228
+ |-------|-----|-------------|
229
+ | Seedream 4.5 | `bytedance-seed/seedream-4.5` | Auto-generates project images |
113
230
 
114
231
  ### 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
232
 
120
- ## Configuration
233
+ <table>
234
+ <tr>
235
+ <td>
236
+
237
+ **Google Gemini** ๐Ÿ”ฅ
238
+ - Gemini 2.5 Flash โšก
239
+ - Gemini 2.5 Pro ๐Ÿš€
240
+ - Gemini 2.0 Flash
241
+
242
+ </td>
243
+ <td>
244
+
245
+ **OpenRouter** ๐ŸŒ
246
+ - Claude 3.5 Sonnet
247
+ - GPT-4o / 4o Mini
248
+ - Llama 3.3 70B
249
+ - DeepSeek R1
250
+ - 400+ more
251
+
252
+ </td>
253
+ <td>
254
+
255
+ **OpenAI** ๐Ÿง 
256
+ - GPT-4o
257
+ - GPT-4o Mini
258
+ - o1
259
+ - o1-mini
260
+
261
+ </td>
262
+ </tr>
263
+ <tr>
264
+ <td>
121
265
 
122
- API keys and rules are stored in `~/.agdi/`:
266
+ **Anthropic** ๐Ÿ’œ
267
+ - Claude 3.5 Sonnet
268
+ - Claude 3.5 Haiku
269
+ - Claude 3 Opus
270
+
271
+ </td>
272
+ <td>
273
+
274
+ **DeepSeek** ๐ŸŒŠ
275
+ - DeepSeek V3
276
+ - DeepSeek R1 (Reasoning)
277
+
278
+ </td>
279
+ <td>
280
+
281
+ **Get Keys** ๐Ÿ”‘
282
+ - [Gemini](https://aistudio.google.com/apikey)
283
+ - [OpenRouter](https://openrouter.ai/keys)
284
+ - [OpenAI](https://platform.openai.com/api-keys)
285
+ - [Anthropic](https://console.anthropic.com/)
286
+ - [DeepSeek](https://platform.deepseek.com/)
287
+
288
+ </td>
289
+ </tr>
290
+ </table>
291
+
292
+ ---
293
+
294
+ ## โš™๏ธ Configuration
295
+
296
+ Config stored in `~/.agdi/`:
123
297
 
124
298
  ```
125
299
  ~/.agdi/
126
- โ”œโ”€โ”€ config.json # API keys and settings
127
- โ”œโ”€โ”€ rules.json # Permission rules
128
- โ”œโ”€โ”€ trusted-workspaces.json # Trusted workspaces
129
- โ””โ”€โ”€ audit.jsonl # Audit log
300
+ โ”œโ”€โ”€ config.json # API keys & settings
301
+ โ”œโ”€โ”€ rules.json # Permission rules
302
+ โ”œโ”€โ”€ trusted-workspaces.json # Trusted directories
303
+ โ””โ”€โ”€ audit.jsonl # Audit log
130
304
  ```
131
305
 
132
306
  ```bash
133
- agdi auth # Interactive setup
134
- agdi auth --status # Show current config
307
+ # Interactive setup
308
+ agdi auth
309
+
310
+ # Show config
311
+ agdi config
312
+
313
+ # Check auth status
314
+ agdi auth --status
315
+ ```
316
+
317
+ ---
318
+
319
+ ## ๐Ÿ“Š Quality Metrics
320
+
321
+ <table>
322
+ <tr>
323
+ <td align="center">
324
+ <h3>0</h3>
325
+ <p>TypeScript Errors</p>
326
+ </td>
327
+ <td align="center">
328
+ <h3>100</h3>
329
+ <p>Tests Passing</p>
330
+ </td>
331
+ <td align="center">
332
+ <h3>22+</h3>
333
+ <p>Security Patterns</p>
334
+ </td>
335
+ <td align="center">
336
+ <h3>900+</h3>
337
+ <p>Weekly Downloads</p>
338
+ </td>
339
+ </tr>
340
+ </table>
341
+
342
+ ---
343
+
344
+ ## ๐Ÿš€ Examples
345
+
346
+ ```bash
347
+ # Create a full-stack app
348
+ agdi build "Create a blog with authentication and markdown support"
349
+
350
+ # Create a dashboard
351
+ agdi build "Build an analytics dashboard with charts using Recharts"
352
+
353
+ # Create an API
354
+ agdi build "Create a REST API with Express, Prisma, and PostgreSQL"
355
+
356
+ # Interactive development
357
+ agdi
358
+ โ†’ Help me debug this React component
359
+ โ†’ Add dark mode to my app
360
+ โ†’ Explain this TypeScript error
135
361
  ```
136
362
 
137
- ## Requirements
363
+ ---
364
+
365
+ ## ๐Ÿ“ฆ Tech Stack
366
+
367
+ - **Runtime**: Node.js 18+
368
+ - **Language**: TypeScript 5.4
369
+ - **CLI Framework**: Commander.js
370
+ - **Prompts**: Inquirer
371
+ - **Styling**: Chalk, Ora
372
+ - **Build**: tsup
373
+ - **Testing**: Vitest
374
+
375
+ ---
376
+
377
+ ## ๐Ÿ”— Links
378
+
379
+ - ๐ŸŒ **Website**: [agdi-dev.vercel.app](https://agdi-dev.vercel.app)
380
+ - ๐Ÿ“ฆ **npm**: [npmjs.com/package/agdi](https://www.npmjs.com/package/agdi)
381
+ - ๐Ÿ™ **GitHub**: [github.com/anassagd432/Agdi-dev](https://github.com/anassagd432/Agdi-dev)
382
+
383
+ ---
384
+
385
+ ## ๐Ÿ“„ License
386
+
387
+ MIT ยฉ [Agdi Systems Inc.](https://agdi-dev.vercel.app)
138
388
 
139
- - Node.js 18 or higher
140
- - npm or yarn
389
+ ---
141
390
 
142
- ## Links
391
+ <div align="center">
143
392
 
144
- - ๐ŸŒ [Website](https://agdi.dev)
145
- - ๐Ÿ“– [Documentation](https://docs.agdi.dev)
146
- - ๐Ÿ™ [GitHub](https://github.com/agdi-dev/agdi)
393
+ **Built with โค๏ธ by [Anass Agdi](https://github.com/anassagd432)**
147
394
 
148
- ## License
395
+ โญ **Star on GitHub** if you find this useful!
149
396
 
150
- MIT ยฉ [Agdi Systems Inc.](https://agdi.dev)
397
+ </div>