@nclamvn/vibecode-cli 1.5.0 → 1.7.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.
- package/.vibecode/learning/fixes.json +1 -0
- package/.vibecode/learning/preferences.json +1 -0
- package/bin/vibecode.js +86 -3
- package/docs-site/README.md +41 -0
- package/docs-site/blog/2019-05-28-first-blog-post.md +12 -0
- package/docs-site/blog/2019-05-29-long-blog-post.md +44 -0
- package/docs-site/blog/2021-08-01-mdx-blog-post.mdx +24 -0
- package/docs-site/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
- package/docs-site/blog/2021-08-26-welcome/index.md +29 -0
- package/docs-site/blog/authors.yml +25 -0
- package/docs-site/blog/tags.yml +19 -0
- package/docs-site/docs/commands/agent.md +162 -0
- package/docs-site/docs/commands/assist.md +71 -0
- package/docs-site/docs/commands/build.md +53 -0
- package/docs-site/docs/commands/config.md +30 -0
- package/docs-site/docs/commands/debug.md +173 -0
- package/docs-site/docs/commands/doctor.md +34 -0
- package/docs-site/docs/commands/go.md +128 -0
- package/docs-site/docs/commands/index.md +79 -0
- package/docs-site/docs/commands/init.md +42 -0
- package/docs-site/docs/commands/learn.md +82 -0
- package/docs-site/docs/commands/lock.md +33 -0
- package/docs-site/docs/commands/plan.md +29 -0
- package/docs-site/docs/commands/review.md +31 -0
- package/docs-site/docs/commands/snapshot.md +34 -0
- package/docs-site/docs/commands/start.md +32 -0
- package/docs-site/docs/commands/status.md +37 -0
- package/docs-site/docs/commands/undo.md +83 -0
- package/docs-site/docs/configuration.md +72 -0
- package/docs-site/docs/faq.md +83 -0
- package/docs-site/docs/getting-started.md +119 -0
- package/docs-site/docs/guides/agent-mode.md +94 -0
- package/docs-site/docs/guides/debug-mode.md +83 -0
- package/docs-site/docs/guides/magic-mode.md +107 -0
- package/docs-site/docs/installation.md +98 -0
- package/docs-site/docs/intro.md +67 -0
- package/docs-site/docusaurus.config.ts +141 -0
- package/docs-site/package-lock.json +18039 -0
- package/docs-site/package.json +48 -0
- package/docs-site/sidebars.ts +70 -0
- package/docs-site/src/components/HomepageFeatures/index.tsx +72 -0
- package/docs-site/src/components/HomepageFeatures/styles.module.css +16 -0
- package/docs-site/src/css/custom.css +30 -0
- package/docs-site/src/pages/index.module.css +23 -0
- package/docs-site/src/pages/index.tsx +44 -0
- package/docs-site/src/pages/markdown-page.md +7 -0
- package/docs-site/src/theme/Footer/index.tsx +127 -0
- package/docs-site/src/theme/Footer/styles.module.css +285 -0
- package/docs-site/static/.nojekyll +0 -0
- package/docs-site/static/img/docusaurus-social-card.jpg +0 -0
- package/docs-site/static/img/docusaurus.png +0 -0
- package/docs-site/static/img/favicon.ico +0 -0
- package/docs-site/static/img/logo.svg +1 -0
- package/docs-site/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/docs-site/static/img/undraw_docusaurus_react.svg +170 -0
- package/docs-site/static/img/undraw_docusaurus_tree.svg +40 -0
- package/docs-site/tsconfig.json +8 -0
- package/package.json +5 -2
- package/src/agent/orchestrator.js +104 -35
- package/src/commands/build.js +13 -3
- package/src/commands/debug.js +109 -1
- package/src/commands/git.js +923 -0
- package/src/commands/go.js +9 -2
- package/src/commands/learn.js +294 -0
- package/src/commands/shell.js +486 -0
- package/src/commands/undo.js +281 -0
- package/src/commands/watch.js +556 -0
- package/src/commands/wizard.js +322 -0
- package/src/core/backup.js +325 -0
- package/src/core/learning.js +295 -0
- package/src/debug/image-analyzer.js +304 -0
- package/src/debug/index.js +30 -1
- package/src/index.js +50 -0
- package/src/ui/__tests__/error-translator.test.js +390 -0
- package/src/ui/dashboard.js +364 -0
- package/src/ui/error-translator.js +775 -0
- package/src/utils/image.js +222 -0
package/src/commands/debug.js
CHANGED
|
@@ -8,8 +8,10 @@ import ora from 'ora';
|
|
|
8
8
|
import path from 'path';
|
|
9
9
|
import fs from 'fs-extra';
|
|
10
10
|
import readline from 'readline';
|
|
11
|
+
import inquirer from 'inquirer';
|
|
11
12
|
import { printBox, printError, printSuccess, printWarning, printNextStep } from '../ui/output.js';
|
|
12
13
|
import { createDebugEngine } from '../debug/index.js';
|
|
14
|
+
import { ImageAnalyzer } from '../debug/image-analyzer.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Debug Command Entry Point
|
|
@@ -24,6 +26,15 @@ export async function debugCommand(args = [], options = {}) {
|
|
|
24
26
|
try {
|
|
25
27
|
const projectPath = process.cwd();
|
|
26
28
|
|
|
29
|
+
// Handle image input modes first
|
|
30
|
+
if (options.image) {
|
|
31
|
+
return handleImageDebug(options.image, projectPath, options);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (options.clipboard) {
|
|
35
|
+
return handleClipboardDebug(projectPath, options);
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
// Parse command arguments
|
|
28
39
|
const input = parseDebugInput(args, options);
|
|
29
40
|
|
|
@@ -177,6 +188,100 @@ Prevention rules added to:
|
|
|
177
188
|
}
|
|
178
189
|
}
|
|
179
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Handle image file debug
|
|
193
|
+
*/
|
|
194
|
+
async function handleImageDebug(imagePath, projectPath, options) {
|
|
195
|
+
const analyzer = new ImageAnalyzer(projectPath);
|
|
196
|
+
|
|
197
|
+
try {
|
|
198
|
+
const analysis = await analyzer.analyzeImage(imagePath);
|
|
199
|
+
console.log(analyzer.formatAnalysis(analysis));
|
|
200
|
+
|
|
201
|
+
// If error detected, ask to fix
|
|
202
|
+
if (analysis.errorType && analysis.suggestedFix) {
|
|
203
|
+
const { fix } = await inquirer.prompt([{
|
|
204
|
+
type: 'confirm',
|
|
205
|
+
name: 'fix',
|
|
206
|
+
message: 'Apply suggested fix?',
|
|
207
|
+
default: true
|
|
208
|
+
}]);
|
|
209
|
+
|
|
210
|
+
if (fix) {
|
|
211
|
+
return debugWithAnalysis(analysis, projectPath, options);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
} catch (error) {
|
|
215
|
+
printError(error.message);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Handle clipboard image debug
|
|
221
|
+
*/
|
|
222
|
+
async function handleClipboardDebug(projectPath, options) {
|
|
223
|
+
const analyzer = new ImageAnalyzer(projectPath);
|
|
224
|
+
|
|
225
|
+
try {
|
|
226
|
+
const analysis = await analyzer.analyzeClipboard();
|
|
227
|
+
console.log(analyzer.formatAnalysis(analysis));
|
|
228
|
+
|
|
229
|
+
// If error detected, ask to fix
|
|
230
|
+
if (analysis.errorType && analysis.suggestedFix) {
|
|
231
|
+
const { fix } = await inquirer.prompt([{
|
|
232
|
+
type: 'confirm',
|
|
233
|
+
name: 'fix',
|
|
234
|
+
message: 'Apply suggested fix?',
|
|
235
|
+
default: true
|
|
236
|
+
}]);
|
|
237
|
+
|
|
238
|
+
if (fix) {
|
|
239
|
+
return debugWithAnalysis(analysis, projectPath, options);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
} catch (error) {
|
|
243
|
+
printError(error.message);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Debug with analysis from image
|
|
249
|
+
*/
|
|
250
|
+
async function debugWithAnalysis(analysis, projectPath, options) {
|
|
251
|
+
// Build error description from analysis
|
|
252
|
+
const errorDescription = [
|
|
253
|
+
analysis.errorType,
|
|
254
|
+
analysis.errorMessage,
|
|
255
|
+
analysis.location ? `at ${analysis.location}` : '',
|
|
256
|
+
analysis.rootCause ? `Cause: ${analysis.rootCause}` : ''
|
|
257
|
+
].filter(Boolean).join(' - ');
|
|
258
|
+
|
|
259
|
+
console.log(chalk.cyan(`\n Attempting to fix: ${analysis.errorType}\n`));
|
|
260
|
+
|
|
261
|
+
// Create debug engine and run
|
|
262
|
+
const engine = createDebugEngine(projectPath, {
|
|
263
|
+
autoFix: true,
|
|
264
|
+
maxAttempts: options.attempts || 3,
|
|
265
|
+
verbose: options.verbose || false,
|
|
266
|
+
interactive: !options.quiet
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const input = {
|
|
270
|
+
description: errorDescription,
|
|
271
|
+
suggestedFix: analysis.suggestedFix,
|
|
272
|
+
fromImage: true
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
const result = await engine.debug(input);
|
|
276
|
+
|
|
277
|
+
// Show result
|
|
278
|
+
if (result.status === 'resolved') {
|
|
279
|
+
printSuccess('Bug fixed successfully!');
|
|
280
|
+
} else {
|
|
281
|
+
printWarning('Could not auto-fix. Try: vibecode assist "' + analysis.errorMessage + '"');
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
180
285
|
/**
|
|
181
286
|
* Show debug command help
|
|
182
287
|
*/
|
|
@@ -191,11 +296,13 @@ Usage:
|
|
|
191
296
|
vibecode debug --auto Auto-scan project for errors
|
|
192
297
|
vibecode debug --log "error text" Fix from error log
|
|
193
298
|
vibecode debug --image path/to/img Fix from screenshot
|
|
299
|
+
vibecode debug --clipboard Fix from clipboard image
|
|
194
300
|
|
|
195
301
|
Options:
|
|
196
302
|
--auto Auto-scan mode - find and fix errors
|
|
197
303
|
--log <text> Provide error log directly
|
|
198
304
|
--image <path> Provide error screenshot
|
|
305
|
+
--clipboard Analyze image from clipboard
|
|
199
306
|
--attempts <n> Max fix attempts (default: 3)
|
|
200
307
|
--verbose Show detailed output
|
|
201
308
|
--quiet Minimal output
|
|
@@ -204,7 +311,8 @@ Examples:
|
|
|
204
311
|
vibecode debug "Cannot read property of undefined"
|
|
205
312
|
vibecode debug --auto
|
|
206
313
|
vibecode debug --log "TypeError: x is not a function"
|
|
207
|
-
vibecode debug --
|
|
314
|
+
vibecode debug --image ./error-screenshot.png
|
|
315
|
+
vibecode debug --clipboard`, { borderColor: 'cyan' });
|
|
208
316
|
console.log();
|
|
209
317
|
}
|
|
210
318
|
|