ripple-ai-detector
Version:
🌊 Ripple AI Bug Detector - Built by an AI that knows its flaws. Catch AI-generated bugs before you commit.
68 lines (55 loc) • 2.26 kB
text/typescript
import { logger } from '../utils/logger';
import { AuthManager } from '../auth/auth-manager';
import { UsageTracker } from '../usage/usage-tracker';
export async function upgradeCommand(): Promise<void> {
try {
logger.header();
// Get current status
const authManager = new AuthManager();
const usageTracker = new UsageTracker();
const status = await authManager.getStatus();
const usage = await usageTracker.getUsage();
// Show current plan
if (status.authenticated && status.user) {
logger.info(`Current plan: ${status.user.plan}`);
logger.usageStatus(usage.current, usage.limit);
logger.newLine();
}
// Show upgrade benefits
logger.info('🚀 Ripple Pro Benefits:');
logger.info(' ✓ Unlimited AI bug validations');
logger.info(' ✓ Priority email support');
logger.info(' ✓ Early access to new features');
logger.info(' ✓ Advanced AI detection algorithms');
logger.newLine();
// Show pricing
logger.money('💰 Pricing: $49/month');
logger.info(' • Less than $1.60 per day');
logger.info(' • Pays for itself with one prevented bug');
logger.info(' • Cancel anytime');
logger.newLine();
// Show value proposition
if (usage.current > 0) {
const hoursPerBug = 2; // Average debugging time
const hoursSaved = usage.current * hoursPerBug;
const hourlyRate = 75; // Average developer hourly rate
const valueSaved = hoursSaved * hourlyRate;
logger.money(`This month you've saved ~${hoursSaved} hours of debugging`);
logger.money(`That's worth ~$${valueSaved} of your time!`);
logger.newLine();
}
// Upgrade instructions
logger.upgrade('Ready to upgrade?');
if (status.authenticated && status.licenseKey) {
const upgradeUrl = `https://ripple.dev/upgrade?key=${status.licenseKey}`;
logger.info(`Visit: ${upgradeUrl}`);
} else {
logger.info('Visit: https://ripple.dev/pricing');
}
logger.newLine();
logger.tip('Questions? Email us at: support@ripple.dev');
} catch (error) {
logger.error(`Upgrade command failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
process.exit(1);
}
}