TL;DR: Learn how to create, develop, test, and publish CLI tools in TypeScript using Komutan. This toolkit streamlines the entire process of building command-line applications with modern tooling and best practices.
Table of Contents
Introduction
I was playing with CLI tools and thought it would be cool to make one and publish. While I was searching for tech to use, I saw Cobra and cobra-cli in Go which is absolutely perfect. After playing with it for some time, I decided to make CLI tools also in TypeScript, but I had a hard time finding good resources, so here we are with Komutan.
What is Komutan?
Komutan is a CLI toolkit built on top of Commander.js that streamlines the process of creating, developing, testing, and publishing CLI apps.
Getting Started
Make sure that you have Node.js and npm on your system, and after that, you can just install Komutan with a simple command:
npx komutan
Tutorial: Building a Welcome CLI Tool
In this tutorial, let's create a simple CLI tool that welcomes a given name. Let's create a new directory:
mkdir welcome
cd welcome
After making sure that you are in the welcome directory, run the komutan init <name>
command:
npx komutan init welcome
This will scaffold your CLI app. You can see the project tree in the GitHub repository.

Now let's test our CLI:
npx komutan test # you may need to add sudo
welcome

By default, you will have a hello command. Let's try that:

Perfect! Everything is working. Now let's add a welcome command and modify it.
You can add a new command by using the komutan add <name>
command:
npx komutan add welcome


Now let's make it so it accepts a name:

Run the test command again:

And now use it:

Here it is! Everything is working fine.
Now for the last step, you will probably want to publish your CLI, and it's as easy as running:
npx komutan publish # you may need to use sudo
Conclusion
Done! You now know how to ship CLI apps like crazy. Komutan makes it incredibly easy to create, develop, test, and publish CLI tools in TypeScript with minimal setup and configuration.
Key Takeaways
- Komutan Streamlines Development: From scaffolding to publishing, everything is handled with simple commands
- TypeScript + Commander.js: Built on proven technologies for robust CLI development
- Easy Command Management: Add new commands with a single command and focus on functionality
- One-Click Publishing: Publish your CLI tools to npm with minimal configuration
Learn More
If you want to dive deeper into CLI development and TypeScript: