It wasn’t perfect, but I built it — and that’s the vibe🌼
Hellooo Devs👋
It’s me, Khushi — A curious kid just figuring things out 🌸
This is not some expert tutorial.
This is just a lil story about how I learned to build a CLI (Command Line Interface) tool — in my own messy, random way 😭✨
🌼Where I Started
I just started with the basics — JavaScript vibes only.
Learning how to play with strings, arrays, and the console.
This gave me the lil push to actually try something on my own.
💭My First Thought:
What if I build a CLI that counts how many lines are there in my .txt file?
Sounds simple right? Let’s gooo.
For this, I used the Commander library 👉https://www.npmjs.com/package/commander?activeTab=readme
It helped me create and print commands easily.
Here’s what it looked like 👇
✨ Level Up: Gimme Some Colors!
After this lil project, I thought — let’s build something cuter and more interactive.
So I built a CLI that:
- Shows a fancy welcome banner using figlet (https://www.npmjs.com/package/figlet)
- Prompts the user’s name using inquirer (https://www.npmjs.com/package/inquirer)
- Greets them back with colorful text using gradient-string (https://www.npmjs.com/package/gradient-string?activeTab=readme)
Basically, a whole vibe.
🚧 The Problem I Faced (Yup, Struggled)
Okay, this one actually got me 😵💫
I had issues with type: module in package.json.
At first, my CLI wasn’t working because I was mixing Node.js modules and ES modules 💀
So I had to figure it out:
Use .cjs instead of .js (yeah that works!)
OR update package.json to support both module types.
Here’s a lil screenshot of that chaos:
When I saw that I can actually make my terminal look cute with colors and banners, I was sold 😂✨
🔗GitHub Repo link : - https://github.com/khushikumari239/CLI-Node.js.git
⚙️What I Built (the basic starter pack)
- Showed a cool banner
- Asked the user their name
- Greeted them back with colorful text (obviously)
All this — in the terminal.
Running it in Node.js was actually not that scary once I broke it down into small lil steps.
Also had to figure out promises, callbacks, and async code (not gonna lie, it fried my brain a bit but we survived 🫠)
🌸What I Learned (aka life lessons lol)
- Breaking stuff into tiny steps is literally the hack
- Using ready-made libraries is NOT cheating — it’s smart
- You learn the most by just TRYING and tweaking random stuff
If you’ve been thinking about building a CLI — just do it. Start small, keep it fun, don’t overthink.
Trust me, you’ll vibe.
So yeah — figuring this out was a whole mission but I did it 🤌
💌 Let’s Talk!
That’s my messy lil CLI story, straight from me to you 🤍
Not perfect, but definitely worth it.
Are you building something? Tell me in the comments!!
I wanna see your journey too — let’s build, fail, laugh, and vibe together 🫶
Big thanks to GeeksforGeeks (GFG)💚
Top comments (16)
Hey Khushi, that's a great write up. Keep it up.
Btw did you write this blog from mobile phone? I see you added the mobile captured images.
Thank you so much Rohan for the support 🌻✨
Nope I used my laptop.... The images I clicked with my phone then Added them using my laptop...
try capturing screenshots directly from laptop. Use the built in snipping tool
OKKKK Rohan thanks for the suggestions i will do that from the next time
That is super cool. Looks like gemini cli having nice colours. I run that cli tool as
'npx https://github.com/google-gemini/gemini-cli
and that will pull into a temp location and running it; so a zero install way of always running the latest tool. you can make an alias for such cli tools like yours.That’s such a cool trick — running it via
npx
straight from the GitHub repo is honestly the smoothest way to stay up-to-date without installs 🔥Hadn’t thought of creating an alias for mine, but now it’s on my to-do list 😄
Thanks for sharing this — I am gonna do thisss!
Great job! I like your writing style — it's got a lot of personality!
Appreciate that a lot! Just trying to keep it fun, honest, and a little bit chaotic — like my dev journey 😅
Great job !
Thank You ⭐
This is so real, the whole module chaos got me the first time too! Curious, what's your favorite npm library so far for CLI stuff?
Aahhh thank you, Datallio! 😭 Of course, that module chaos… oh my god, it hit me hard too, but it’s finally workingg 😮💨
I’m really new to all these CLI things, but I gotta say — I loved gradient-string for the colorss 😅✨
Also, I just dropped another blog about Gemini CLI — it's pretty cool if you're into that kind of CLI's : - dev.to/khushimehappy/too-broke-for...
Not sure how I got here, but "The Code" made my day. Thanks!
The algorithm knew what it was doing 😌
Happy to hear the code made your day!
Very cool! love the design.
Thank Youuu🙌