UNPKG

helem-cli

Version:

A fun CLI tool that displays a shocked ASCII art face with encouraging messages when you run upgrade commands

88 lines (75 loc) 4.73 kB
#!/usr/bin/env node const { Command } = require('commander'); const program = new Command(); // Encouraging sentences to display randomly const encouragingMessages = [ "You've got this! 💪", "Take a deep breath, it's going to be okay! 🌟", "Remember: you can always rollback! 🔄", "Trust the process, you're a pro! ✨", "Upgrades are scary, but you're scarier! 👻", "Fortune favors the brave developer! 🚀", "This too shall pass (hopefully without breaking anything)! 🤞", "You've survived worse upgrades than this! 💯", "Backup ready? Let's do this thing! 📦", "The only way out is through... the upgrade! 🛤️", "Your future self will thank you! 🙏", "Breaking things is just learning in disguise! 🎭", "Every expert was once a beginner who didn't give up! 🌱", "You're braver than you believe! 🦁", "Embrace the chaos, you're the captain now! ⚡" ]; // Function to get a random encouraging message function getRandomMessage() { const randomIndex = Math.floor(Math.random() * encouragingMessages.length); return encouragingMessages[randomIndex]; } // ASCII art of a person in shock const shockFace = ``; const simpleShockFace = ` ..+x+:.. ..::x$$$$$$x:.::. .....X&&&&&&&&&$;:::. ;;:..X&X+;+xXXxX&&;:;;+. +:..:x;::....::;+XX::+x; .+:..:+;;:::::::;+xx..+xx ::...;XX++X+::;xXX$$:.;xx: ........:Xxxx;xX+:X$xx$X+:::;;: .............:+xX$$+;++;:::;;+XxxX;::.....::::::::::::::. ...............:;+xXXx:X&x;.::.::.++;;;;x&$+x+;::...........::::::;;:. ...............:;+xxx;. :$X+;:::++;xx;;+xX$: .:+xx+;;::..........:::::::. ..............::;+xX; +Xx;:;X$$&$++xXX .+x+;;::::............+; :...........::;++xx. ;XXx+Xx$$$X$XX$+ .+x+;;:::::::::::;xx x;::.....::;;+xXx. .X$Xx+$&&&XXX$$: .;XXx+;;;;;;;;;;+X: :+;::;;+++xXX$&&&$Xx: :$XX++;;+XX$$x .;;;;;;x$$XXx++++xx+x; ;x+xXxxX$$$$$Xx++++++++;. x$$x+$&$x$&$; .:;;;;:::::::;:;;;;;++xxX$: .xxx+++++xx+++;;;;++++++++;;;;;;++XXX$$$$$&&$$X++xx+;;:::::::::::::;:;;+xxXX$X: .x$$XXXxx++++++++++;;;:::::::;;::;xX$&&&&$X+;;x+:::::....:::;;;;;;++xX$$$X. x$$XXXxxxxx+++++;::::......::;::;x$&&&X;::+::::.....:::;:+xxxxxx$$$$$x .X$XXxxxx+x+x+x+::..............::;;::..::.........::;+;xxxXx++$&&&&: +$$XxXXXXxxX++::......................:.........:;:;++XxXxxXXxxx;. ;xXXX$xXX++:::..........................:...:;;;:xxXXXXXx; x$$XX+x+:.::.........................:..::;;;:xXXX$x .xXXxx;:.::.........................:.::;;;;:+XXx. .xx+;:..::........................::::;;;;;+Xx ;+;:.:::................. ..::..::::;;;;;;x ;;::..::.:............ ..:::...::::;;;;;;: .;:::.::.::.........::::::.....::::;;;;;;: ::::::::::............:......::::;;;;+;;. :::::::::::.....::..........:.::::;;;++;. `; program .name('helem') .description('CLI tool that shows ASCII art reactions') .version('1.0.0'); program .command('upgrade') .description('Show a shocked face ASCII art with encouragement') .action(() => { console.log(simpleShockFace); console.log('\n' + ' ' + getRandomMessage()); }); // Show help if no command is provided if (process.argv.length === 2) { program.help(); } program.parse();