Developers love CLI tools! So much so that I’m sure we would jump at the chance to do everything on a computer with the comfort of a command line. And why not do just that? With the help of modern libraries and frameworks, building our own CLI is a matter of a few hours or even minutes. Especially in Node, you can easily build exciting command-line interfaces using the oclif framework.
In this article, we are going to create a simple CLI tool to help us track our weight over time. It has simple features like adding a new weight record and displaying past records.
Since we are using oclif to easily complete this task, let’s try to understand exactly what it is.
We can create two types of command-line tools in Oclif: single- and multi-command. Single-command CLIs provide only one command option (similar to
curl commands in Linux). Multi-command programs support subcommands that proceed the main command.
npm are good examples of multi-command tools.
In this tutorial, we are building a multi-command program that supports
show subcommands to add new weight records and display old records.
In this article, we are going to create a simple CLI tool to help us track our weight over time. It has simple features like adding a new weight record and displaying past records. Build a weight tracking CLI tool with oclif in Node. Learn to Build CLI Automation Tools with Node.js