Okay, so I wanted to mess around with * and see if I could make a simple CLI tool that, uh, cheers for me. Like, a digital cheerleader. Sounds silly, I know, but it’s a good way to learn the basics, right?
![Commander Cheerleader Secrets: How to Become a Pro?](https://www.bookwormandsilverfish.com/wp-content/uploads/2025/02/bc5cc47ea0b475fdabf6fbf6a49edb7e.jpeg)
Setting Up
First, I made sure I had * and npm installed. Pretty standard stuff. Then, I created a new project folder and ran npm init -y
. This just creates a basic file so I can manage my dependencies.
Next up, I installed Commander: npm install commander
. Boom, done. This gives us all the tools we need to build our command-line interface.
Coding the Cheerleader
I created a new file, , and started coding. I started by importing {program} from “commander”.
Then I created a new command with name cheer and description “Give you some motivation”.
I defined an option name and its short and long form -n –name and the description: the user’s name.
![Commander Cheerleader Secrets: How to Become a Pro?](https://www.bookwormandsilverfish.com/wp-content/uploads/2025/02/b38a86c611c7e85be9b0b9301c3eeee3.jpeg)
I want to use the name and created a sentence to cheer the user with his or her name. So I wrote the action function.
Last step is parsing the arguments. I used
Testing it Out
To see it in action I did node * -h. It printed the discriptions and help info.
I ran it like this: node * cheer -n "MyName"
. And it worked! It printed out a little cheer with “MyName”.
![Commander Cheerleader Secrets: How to Become a Pro?](https://www.bookwormandsilverfish.com/wp-content/uploads/2025/02/e9d5d6646f073b3ce6408fa4b95542f7.jpeg)
Wrapping Up
So, yeah, that’s it. A super simple CLI cheerleader built with *. It was a fun little project, and I learned a few things along the way. I might even add more features to it later, like custom cheers or something. Who knows! The important thing is, I got my hands dirty and built something, even if it’s just a silly little program that shouts encouragement at me.