Heart CLI
Heart CLI is the control module of Heart. It allows every other module to work together, and is able to control the Heart API and the analysis modules. All of that by exposing a small CLI.
Note that you must install an analysis module too, to have a minimum viable installation of Heart.
Read more about the purpose, design and general installation of Heart.
Package manager
In the following sections, every examples are using NPM as package manager, but you can use any other you prefer: Yarn, pnpm...
Installation
- Add the package to your project:
npm install @fabernovel/heart-cli
- Add an analysis module
Usage
General
npx heart --help
This command displays the list of commands you can use, regarding your installed modules.
If you install Heart API or each time you install an analysis module, a new command will be available.
Example
We assume that the analysis module Heart Observatory is installed.
If you want to start an analysis, you can use one of the following options:
-
npx heart observatory --inline '{"host": "heart.fabernovel.com"}'
Or:
-
npx heart observatory --file observatory.json
With the following content for the observatory.json
file:
{
"host": "heart.fabernovel.com"
}
You can also provide a minimum threshold that you want your analysis to reach, by using the --threshold
option (the value must be a number between 0 and 100):
Note that Heart does a soft check: the program does not trigger an error if the threshold is not reached.