UNPKG

podx

Version:

🚀 PODx - Ultimate X (Twitter) Scraper CLI with AI-powered bot detection and crypto analysis

59 lines (47 loc) 1.49 kB
#!/usr/bin/env bun import { Command } from 'commander'; import { registerCommands } from '@podx/cli'; import { showWelcomeBanner, runInteractiveMode } from '@podx/cli'; import { logger } from '@podx/core'; // Create the main program const program = new Command(); // Set up the program program .name('podx') .description('🚀 PODx - Ultimate X (Twitter) Scraper CLI') .version('2.0.0') .option('-v, --verbose', 'Enable verbose logging') .option('--no-banner', 'Skip welcome banner'); // Register all commands registerCommands(program); // Handle interactive mode when no command is provided program.action(async (options) => { if (options.verbose) { process.env.LOG_LEVEL = 'debug'; } logger.info('Starting PODx CLI', { operation: 'cli_start', version: '2.0.0', interactive: true }); if (!options.noBanner) { showWelcomeBanner(); } await runInteractiveMode(); }); // Handle uncaught errors process.on('uncaughtException', (error) => { logger.error('Uncaught exception', { operation: 'uncaught_exception' }, error); console.error('❌ Uncaught exception:', error.message); process.exit(1); }); process.on('unhandledRejection', (reason, promise) => { logger.error('Unhandled rejection', { operation: 'unhandled_rejection', reason: reason instanceof Error ? reason.message : String(reason) }); console.error('❌ Unhandled rejection:', reason); process.exit(1); }); // Parse command line arguments program.parse();