?> Author: Jimmy Lan
In this article, we will discuss ways to run the Habits CLI locally during development process.
After cloning this repository, run
npm installto install all project dependencies.
A convenient script is provided to compile and run habits CLI using ts-node/register. This script is located in the bin folder and is called habits-dev.
For example, from the root of this repository, you can run:
./bin/habits-dev <...>to compile and start the habits CLI. Note that this command may be slow on some machines, because the command will first compile the TypeScript code before starting the program.
Alternatively, you may run
npm run buildand follow by
./bin/habits <...>This will compile the program using tsc, then run the JavaScript files from the dist output folder.
Note that with this approach, you need to recompile the scripts manually using npm run build whenever you make a code change.