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