UNPKG

ripple-ai-detector

Version:

🌊 Ripple AI Bug Detector - Built by an AI that knows its flaws. Catch AI-generated bugs before you commit.

73 lines • 2.74 kB
#!/usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const chalk_1 = __importDefault(require("chalk")); const fs_1 = require("fs"); const path_1 = require("path"); const validate_1 = require("./commands/validate"); const init_1 = require("./commands/init"); const auth_1 = require("./commands/auth"); const upgrade_1 = require("./commands/upgrade"); // Read version from package.json const packageJson = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../package.json'), 'utf8')); const version = packageJson.version; const program = new commander_1.Command(); // ASCII Art Banner const banner = ` 🌊 ${chalk_1.default.bold.blue('Ripple AI Bug Detector')} ${chalk_1.default.gray('Catch AI-generated bugs before you commit')} `; program .name('ripple') .description('AI Bug Detector - Built by an AI that knows its flaws') .version(version) .addHelpText('beforeAll', banner); // Main validate command program .command('validate') .description('Analyze staged files for AI-generated bugs') .option('-f, --format <type>', 'output format (console|json)', 'console') .option('--files <files...>', 'specific files to validate') .option('--all', 'validate all files (not just staged)') .action(validate_1.validateCommand); // Initialize project program .command('init') .description('Initialize Ripple in current project') .action(init_1.initCommand); // Authentication commands program .command('auth') .description('Manage authentication') .addCommand(new commander_1.Command('login') .description('Login with license key') .argument('<key>', 'license key') .action(auth_1.authCommand.login)) .addCommand(new commander_1.Command('status') .description('Check authentication status') .action(auth_1.authCommand.status)) .addCommand(new commander_1.Command('logout') .description('Logout and clear credentials') .action(auth_1.authCommand.logout)); // Upgrade command program .command('upgrade') .description('Upgrade to Pro plan') .action(upgrade_1.upgradeCommand); // Handle unknown commands program.on('command:*', () => { console.error(chalk_1.default.red(`Unknown command: ${program.args.join(' ')}`)); console.log(chalk_1.default.gray('Run "ripple --help" for available commands')); process.exit(1); }); // Parse arguments program.parse(); // Show help if no command provided if (!process.argv.slice(2).length) { program.outputHelp(); } //# sourceMappingURL=cli.js.map