#!/usr/bin/env node import { CONFIG } from './src/config/index.js'; import { setLogLevel } from './src/utils/index.js'; import { startSniper, showStatus, clearCache } from './src/commands/index.js'; // Set log level setLogLevel(CONFIG.LOG_LEVEL); // Parse command line arguments const args = process.argv.slice(2); const command = args[0] || 'start'; switch (command) { case 'start': case 'sniper': case 'run': startSniper().catch(error => { console.error('Fatal error:', error); process.exit(1); }); break; case 'status': case 'st': showStatus(); break; case 'clear': case 'clean': clearCache(); break; case 'help': case '--help': case '-h': console.log(` Byreal Sniper Bot - Automated LP Position Sniper Usage: node index.js [command] Commands: start, sniper, run Start the sniper bot (default) status, st Show current copied and closed positions clear, clean Clear all position caches help Show this help message Configuration: Edit .env file to configure: - PRIVATE_KEY: Your wallet private key - COPY_MULTIPLIER: Copy multiplier (default: 1.5) - MAX_USD_VALUE: Maximum position size - POLL_INTERVAL_MS: Polling interval `); break; default: console.log(`Unknown command: ${command}`); console.log('Run "node index.js help" for usage information'); process.exit(1); }