@nclamvn/vibecode-cli 2.0.0 → 2.2.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 (53) hide show
  1. package/.vibecode/learning/fixes.json +1 -0
  2. package/.vibecode/learning/preferences.json +1 -0
  3. package/README.md +310 -49
  4. package/SESSION_NOTES.md +154 -0
  5. package/bin/vibecode.js +235 -2
  6. package/package.json +5 -2
  7. package/src/agent/decomposition.js +476 -0
  8. package/src/agent/index.js +391 -0
  9. package/src/agent/memory.js +542 -0
  10. package/src/agent/orchestrator.js +917 -0
  11. package/src/agent/self-healing.js +516 -0
  12. package/src/commands/agent.js +349 -0
  13. package/src/commands/ask.js +230 -0
  14. package/src/commands/assist.js +413 -0
  15. package/src/commands/build.js +345 -4
  16. package/src/commands/debug.js +565 -0
  17. package/src/commands/docs.js +167 -0
  18. package/src/commands/git.js +1024 -0
  19. package/src/commands/go.js +635 -0
  20. package/src/commands/learn.js +294 -0
  21. package/src/commands/migrate.js +341 -0
  22. package/src/commands/plan.js +8 -2
  23. package/src/commands/refactor.js +205 -0
  24. package/src/commands/review.js +126 -1
  25. package/src/commands/security.js +229 -0
  26. package/src/commands/shell.js +486 -0
  27. package/src/commands/templates.js +397 -0
  28. package/src/commands/test.js +194 -0
  29. package/src/commands/undo.js +281 -0
  30. package/src/commands/watch.js +556 -0
  31. package/src/commands/wizard.js +322 -0
  32. package/src/config/constants.js +5 -1
  33. package/src/config/templates.js +146 -15
  34. package/src/core/backup.js +325 -0
  35. package/src/core/error-analyzer.js +237 -0
  36. package/src/core/fix-generator.js +195 -0
  37. package/src/core/iteration.js +226 -0
  38. package/src/core/learning.js +295 -0
  39. package/src/core/session.js +18 -2
  40. package/src/core/test-runner.js +281 -0
  41. package/src/debug/analyzer.js +329 -0
  42. package/src/debug/evidence.js +228 -0
  43. package/src/debug/fixer.js +348 -0
  44. package/src/debug/image-analyzer.js +304 -0
  45. package/src/debug/index.js +378 -0
  46. package/src/debug/verifier.js +346 -0
  47. package/src/index.js +102 -0
  48. package/src/providers/claude-code.js +12 -7
  49. package/src/templates/index.js +724 -0
  50. package/src/ui/__tests__/error-translator.test.js +390 -0
  51. package/src/ui/dashboard.js +364 -0
  52. package/src/ui/error-translator.js +775 -0
  53. package/src/utils/image.js +222 -0
package/bin/vibecode.js CHANGED
@@ -17,6 +17,24 @@ import {
17
17
  reviewCommand,
18
18
  snapshotCommand,
19
19
  configCommand,
20
+ goCommand,
21
+ agentCommand,
22
+ debugCommand,
23
+ assistCommand,
24
+ undoCommand,
25
+ learnCommand,
26
+ gitCommand,
27
+ watchCommand,
28
+ shellCommand,
29
+ // Phase K Commands
30
+ testCommand,
31
+ docsCommand,
32
+ refactorCommand,
33
+ securityCommand,
34
+ askCommand,
35
+ migrateCommand,
36
+ // Phase M Commands
37
+ templatesCommand,
20
38
  VERSION
21
39
  } from '../src/index.js';
22
40
 
@@ -79,6 +97,9 @@ program
79
97
  .option('-c, --complete', 'Mark build as complete')
80
98
  .option('-e, --evidence', 'Capture evidence snapshot')
81
99
  .option('-a, --auto', 'Auto-build with Claude Code (--dangerously-skip-permissions)')
100
+ .option('-i, --iterate', 'Iterative build: build-test-fix loop until tests pass')
101
+ .option('-m, --max <n>', 'Max iterations for --iterate mode', parseInt)
102
+ .option('--strict', 'Strict mode: exit with error if tests fail after max iterations')
82
103
  .option('--provider <name>', 'Provider to use: claude-code', 'claude-code')
83
104
  .action(buildCommand);
84
105
 
@@ -86,6 +107,8 @@ program
86
107
  .command('review')
87
108
  .description('Review build against acceptance criteria')
88
109
  .option('--skip-manual', 'Skip manual verification prompts')
110
+ .option('--ai', 'AI-powered code review')
111
+ .option('-p, --path <dir>', 'Specific path to review')
89
112
  .action(reviewCommand);
90
113
 
91
114
  program
@@ -108,7 +131,217 @@ program
108
131
  .action(configCommand);
109
132
 
110
133
  // ─────────────────────────────────────────────────────────────────────────────
111
- // Parse
134
+ // Phase E Commands - Magic Mode
112
135
  // ─────────────────────────────────────────────────────────────────────────────
113
136
 
114
- program.parse();
137
+ program
138
+ .command('go [description...]')
139
+ .description('Magic mode: one command, full automated build')
140
+ .option('-t, --template <id>', 'Use a template (run "vibecode templates" to see list)')
141
+ .option('--name <name>', 'Project/Company name')
142
+ .option('--color <color>', 'Primary brand color (hex)')
143
+ .option('-i, --iterate', 'Enable iterative build mode')
144
+ .option('-m, --max <n>', 'Max iterations for iterative mode', parseInt)
145
+ .option('-o, --open', 'Auto-open result when done')
146
+ .option('-p, --preview', 'Auto-open in browser after build')
147
+ .action((description, options) => {
148
+ const desc = Array.isArray(description) ? description.join(' ') : description;
149
+ goCommand(desc, options);
150
+ });
151
+
152
+ // ─────────────────────────────────────────────────────────────────────────────
153
+ // Phase M Commands - Templates
154
+ // ─────────────────────────────────────────────────────────────────────────────
155
+
156
+ program
157
+ .command('templates')
158
+ .alias('tpl')
159
+ .description('Browse and use project templates')
160
+ .option('-l, --list', 'List all templates')
161
+ .option('-i, --info <id>', 'Show template details')
162
+ .option('-s, --search <query>', 'Search templates')
163
+ .option('-p, --preview <id>', 'Preview template in browser')
164
+ .option('-q, --quiet', 'Non-interactive mode')
165
+ .action(templatesCommand);
166
+
167
+ // ─────────────────────────────────────────────────────────────────────────────
168
+ // Phase F Commands - Agent Mode
169
+ // ─────────────────────────────────────────────────────────────────────────────
170
+
171
+ program
172
+ .command('agent [description...]')
173
+ .description('Agent mode: autonomous multi-module builder with self-healing')
174
+ .option('-n, --new', 'Create new project directory')
175
+ .option('-r, --resume', 'Resume from last stopped module')
176
+ .option('--from <n>', 'Resume from specific module number', parseInt)
177
+ .option('-s, --status', 'Show current agent progress')
178
+ .option('-v, --verbose', 'Show detailed progress')
179
+ .option('--analyze', 'Analyze project structure without building')
180
+ .option('--report', 'Export memory report to markdown')
181
+ .option('--clear', 'Clear agent memory')
182
+ .option('--force', 'Force operation (for --clear)')
183
+ .option('--json', 'Output as JSON (for --analyze, --status)')
184
+ .option('--max-retries <n>', 'Max retries per module', parseInt)
185
+ .option('--skip-tests', 'Skip tests after each module')
186
+ .option('--continue', 'Continue on module failure')
187
+ .option('--stdout', 'Output report to stdout (for --report)')
188
+ .action((description, options) => {
189
+ // Join variadic description
190
+ const desc = Array.isArray(description) ? description.join(' ') : description;
191
+ agentCommand(desc, options);
192
+ });
193
+
194
+ // ─────────────────────────────────────────────────────────────────────────────
195
+ // Phase G Commands - Debug Mode
196
+ // ─────────────────────────────────────────────────────────────────────────────
197
+
198
+ program
199
+ .command('debug [description...]')
200
+ .description('Debug mode: intelligent 9-step bug fixing')
201
+ .option('-i, --interactive', 'Interactive debug session (default if no args)')
202
+ .option('-a, --auto', 'Auto-scan project for errors and fix')
203
+ .option('-l, --log <text>', 'Provide error log directly')
204
+ .option('--image <path>', 'Analyze error from screenshot file')
205
+ .option('--clipboard', 'Analyze error from clipboard image')
206
+ .option('--attempts <n>', 'Max fix attempts (default: 3)', parseInt)
207
+ .option('-v, --verbose', 'Show detailed output')
208
+ .option('-q, --quiet', 'Minimal output')
209
+ .action((description, options) => {
210
+ debugCommand(description || [], options);
211
+ });
212
+
213
+ program
214
+ .command('assist [prompt...]')
215
+ .alias('expert')
216
+ .description('🤝 AI Assist: Direct Claude Code access with full project context')
217
+ .option('--no-context', 'Skip context injection')
218
+ .action((prompt, options) => {
219
+ assistCommand(prompt || [], options);
220
+ });
221
+
222
+ // ─────────────────────────────────────────────────────────────────────────────
223
+ // Phase H Commands - Undo/Rollback
224
+ // ─────────────────────────────────────────────────────────────────────────────
225
+
226
+ program
227
+ .command('undo')
228
+ .description('⏪ Undo/rollback: Restore files to previous state')
229
+ .option('-l, --list', 'List available backups')
230
+ .option('-s, --step <n>', 'Restore to N steps ago', parseInt)
231
+ .option('-c, --clear', 'Clear all backups')
232
+ .option('-f, --force', 'Force operation without confirmation')
233
+ .action(undoCommand);
234
+
235
+ // ─────────────────────────────────────────────────────────────────────────────
236
+ // Phase H5 Commands - Learning Mode
237
+ // ─────────────────────────────────────────────────────────────────────────────
238
+
239
+ program
240
+ .command('learn')
241
+ .description('🧠 View and manage AI learnings from feedback')
242
+ .option('-s, --stats', 'Show learning statistics')
243
+ .option('-c, --clear', 'Clear all learnings')
244
+ .option('-e, --export', 'Export learnings to file')
245
+ .option('-f, --force', 'Skip confirmation prompts')
246
+ .action(learnCommand);
247
+
248
+ // ─────────────────────────────────────────────────────────────────────────────
249
+ // Phase I Commands - Git Integration
250
+ // ─────────────────────────────────────────────────────────────────────────────
251
+
252
+ program
253
+ .command('git [subcommand] [args...]')
254
+ .description('Git integration - commit, diff, branch, push with enhanced UI')
255
+ .option('-a, --auto', 'Auto-stage all changes before commit')
256
+ .option('-m, --message <msg>', 'Commit message')
257
+ .option('--staged', 'Show only staged changes (for diff)')
258
+ .option('--review', 'AI-powered diff review')
259
+ .option('--count <n>', 'Number of commits to show (for log)', parseInt)
260
+ .option('--all', 'Include all files (for add)')
261
+ .action((subcommand, args, options) => {
262
+ gitCommand(subcommand, args || [], options);
263
+ });
264
+
265
+ // ─────────────────────────────────────────────────────────────────────────────
266
+ // Phase I2 Commands - File Watcher
267
+ // ─────────────────────────────────────────────────────────────────────────────
268
+
269
+ program
270
+ .command('watch')
271
+ .description('Watch mode - auto-test/lint/build on file changes')
272
+ .option('-d, --dir <path>', 'Directory to watch')
273
+ .option('-t, --test', 'Run tests on change')
274
+ .option('-l, --lint', 'Run lint on change')
275
+ .option('-b, --build', 'Run build on change')
276
+ .option('-T, --typecheck', 'Run TypeScript check on change')
277
+ .option('-a, --all', 'Run all checks (test, lint, typecheck)')
278
+ .option('-n, --notify', 'Desktop notifications')
279
+ .option('-i, --immediate', 'Run checks immediately on start')
280
+ .action(watchCommand);
281
+
282
+ // ─────────────────────────────────────────────────────────────────────────────
283
+ // Phase I3 Commands - Shell Mode
284
+ // ─────────────────────────────────────────────────────────────────────────────
285
+
286
+ program
287
+ .command('shell')
288
+ .alias('$')
289
+ .description('Interactive shell with vibecode context and AI assistance')
290
+ .action(shellCommand);
291
+
292
+ // ─────────────────────────────────────────────────────────────────────────────
293
+ // Phase K Commands - Maximize Claude Code
294
+ // ─────────────────────────────────────────────────────────────────────────────
295
+
296
+ program
297
+ .command('test [path]')
298
+ .description('🧪 Test generation and running')
299
+ .option('-g, --generate', 'Generate tests with AI')
300
+ .option('-r, --run', 'Run tests')
301
+ .option('-c, --coverage', 'Show coverage')
302
+ .action(testCommand);
303
+
304
+ program
305
+ .command('docs')
306
+ .description('📚 Generate documentation with AI')
307
+ .option('-g, --generate', 'Generate docs')
308
+ .option('-t, --type <type>', 'Doc type: readme, api, architecture, jsdoc, all')
309
+ .action(docsCommand);
310
+
311
+ program
312
+ .command('refactor [path]')
313
+ .description('🔄 AI-powered code refactoring')
314
+ .option('-t, --type <type>', 'Type: clean, dry, performance, architecture, modularize, modernize')
315
+ .option('-d, --description <desc>', 'Custom refactoring description')
316
+ .action(refactorCommand);
317
+
318
+ program
319
+ .command('security')
320
+ .description('🔒 Security audit with AI analysis')
321
+ .option('-f, --fix', 'Auto-fix security issues')
322
+ .action(securityCommand);
323
+
324
+ program
325
+ .command('ask [question...]')
326
+ .description('💬 Ask questions about your codebase')
327
+ .action(askCommand);
328
+
329
+ program
330
+ .command('migrate [description...]')
331
+ .description('🔄 AI-powered code migration')
332
+ .option('-p, --path <path>', 'Specific path to migrate')
333
+ .action(migrateCommand);
334
+
335
+ // ─────────────────────────────────────────────────────────────────────────────
336
+ // Parse - If no command provided, show interactive wizard
337
+ // ─────────────────────────────────────────────────────────────────────────────
338
+
339
+ if (process.argv.length === 2) {
340
+ // No command provided - show interactive wizard
341
+ import('../src/commands/wizard.js').then(m => m.wizardCommand()).catch(err => {
342
+ console.error('Failed to load wizard:', err.message);
343
+ program.help();
344
+ });
345
+ } else {
346
+ program.parse();
347
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nclamvn/vibecode-cli",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Build software with discipline - AI coding with guardrails",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -10,7 +10,9 @@
10
10
  "scripts": {
11
11
  "start": "node bin/vibecode.js",
12
12
  "lint": "eslint src/",
13
- "test": "echo \"Tests coming in Phase B\" && exit 0"
13
+ "test": "node src/ui/__tests__/error-translator.test.js",
14
+ "test:errors": "node src/ui/__tests__/error-translator.test.js",
15
+ "test:errors:verbose": "node src/ui/__tests__/error-translator.test.js --verbose"
14
16
  },
15
17
  "keywords": [
16
18
  "cli",
@@ -29,6 +31,7 @@
29
31
  "dependencies": {
30
32
  "boxen": "^7.1.1",
31
33
  "chalk": "^5.3.0",
34
+ "chokidar": "^5.0.0",
32
35
  "commander": "^12.0.0",
33
36
  "fs-extra": "^11.2.0",
34
37
  "inquirer": "^9.2.12",