Hackernoon logoHow To Create CLI Apps by@hsnice

How To Create CLI Apps

Himanshu Singh Hacker Noon profile picture

@hsniceHimanshu Singh

DynamicProgrammer, Himanshu Singh(on youtube)

Being a programmer, usually, my interaction with the terminal is more than any non-programmer. So, I was thinking why not make CLI apps and decorate them. They should have a nice interface, not like the GUI apps. But a little bit nicer than usual.

So, I created two CLI apps and names them markOne and markTwo. The names are not common because I made them as an assignment.

โœ”๏ธ first CLI app

For the first CLI app, I chose to make a "Test Your Mind" quiz. In which, there are two levels. In level 1, there are 6 questions and to go on level 2 you must give 5 correct answers. Questions are not from any specific topic. So everyone can play.

In level 2, there are 4 questions and you have to give 3 correct answers to pass it.

Now no more talk, you should play it: PLAY

โœ”๏ธsecond CLI app

The second CLI app is also a quiz, but this time it will check that you are an "emoji person" or not.

In this quiz, you have to give answers to 10 questions. And in last, It will show what % are you an emoji person?

You should play it, too: PLAY

๐Ÿงฐ Tools I used

  • replit: as an online IDE
  • javascript: as a programming language in Node.js runtime environment
  • chalk: a dependency, for coloring
  • readline-sync: a dependency, for taking input
  • keyInSelect: method of readline-sync, for MCQ question

๐Ÿ That's all for this

If after playing games you want to comment on how was it, feel free to leave a mail at 'hsnice@gmail.com'. You can also connect with me on Twitter, LinkedIn, Instagram.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.