mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-21 02:26:31 +03:00
Add impeccable CLI with detect subcommand
Usage: npx impeccable detect [file-or-dir-or-url...] Subcommand structure designed for future expansion. The detect subcommand delegates to the existing detection engine with all its modes (jsdom, regex, Puppeteer). - bin/impeccable.mjs: CLI entry point with bun shebang - package.json: bin field added - Export detectCli (main) from detection script - Updated help text to show impeccable detect usage - Updated CLAUDE.md and README.md with CLI docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
8899d514b8
commit
afcff7eea0
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bun
|
||||
|
||||
/**
|
||||
* Impeccable CLI
|
||||
*
|
||||
* Usage:
|
||||
* npx impeccable detect [file-or-dir-or-url...]
|
||||
* npx impeccable detect --fast --json src/
|
||||
* npx impeccable --help
|
||||
*/
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const command = args[0];
|
||||
|
||||
if (!command || command === '--help' || command === '-h') {
|
||||
console.log(`Usage: impeccable <command> [options]
|
||||
|
||||
Commands:
|
||||
detect [file-or-dir-or-url...] Scan for UI anti-patterns and design quality issues
|
||||
|
||||
Options:
|
||||
--help Show this help message
|
||||
|
||||
Run 'impeccable detect --help' for detection-specific options.`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === '--version' || command === '-v') {
|
||||
const pkg = await import('../package.json', { with: { type: 'json' } });
|
||||
console.log(pkg.default.version);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === 'detect') {
|
||||
// Remove 'detect' from argv so the detection script sees the right args
|
||||
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
||||
const { detectCli } = await import('../source/skills/critique/scripts/detect-antipatterns.mjs');
|
||||
await detectCli();
|
||||
} else {
|
||||
console.error(`Unknown command: ${command}`);
|
||||
console.error(`Run 'impeccable --help' for available commands.`);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user