UNPKG

ripple-ai-detector

Version:

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

57 lines • 2.75 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.initCommand = initCommand; const logger_1 = require("../utils/logger"); const config_1 = require("../config/config"); const file_utils_1 = require("../utils/file-utils"); const path_1 = __importDefault(require("path")); async function initCommand() { try { logger_1.logger.header(); logger_1.logger.info('Initializing Ripple in current project...'); const cwd = process.cwd(); // Check if config already exists const hasConfig = await config_1.configManager.hasConfigFile(cwd); if (hasConfig) { logger_1.logger.warning('Ripple configuration already exists in this project'); logger_1.logger.tip('Edit .ripple.config.js to customize settings'); return; } // Create default configuration const configPath = await config_1.configManager.createDefaultConfig(cwd); logger_1.logger.success(`Created configuration file: ${path_1.default.relative(cwd, configPath)}`); // Check if this is a git repository const gitDir = path_1.default.join(cwd, '.git'); const isGitRepo = await file_utils_1.FileUtils.isDirectory(gitDir); if (isGitRepo) { logger_1.logger.success('Git repository detected'); logger_1.logger.tip('Run "ripple validate" to analyze staged files'); logger_1.logger.tip('Or run "ripple validate --all" to analyze entire project'); } else { logger_1.logger.warning('Not a git repository'); logger_1.logger.tip('Initialize git with "git init" for best experience'); logger_1.logger.tip('Or use "ripple validate --all" to analyze all files'); } // Show next steps logger_1.logger.newLine(); logger_1.logger.info('🎉 Ripple is ready to catch AI bugs!'); logger_1.logger.newLine(); logger_1.logger.info('Next steps:'); logger_1.logger.info(' 1. Make some code changes'); logger_1.logger.info(' 2. Stage files with "git add"'); logger_1.logger.info(' 3. Run "ripple validate"'); logger_1.logger.info(' 4. Fix any issues found'); logger_1.logger.info(' 5. Commit with confidence!'); logger_1.logger.newLine(); logger_1.logger.tip('Get unlimited validations: ripple.dev/pro'); } catch (error) { logger_1.logger.error(`Initialization failed: ${error instanceof Error ? error.message : 'Unknown error'}`); process.exit(1); } } //# sourceMappingURL=init.js.map