githubEdit

Guardian CLI

The Guardian-CLI is a useful command-line application developed for simplifying management of Guardian project from cloning the repository to checkout to a specific release version, start/stop the project by docker and PM2 as well as cleaning the project and more features. The Guardian-CLI is supposed to be pushed into the npm registry in order that users can install it as a global package and use CLI commands entire their machine or servers.

Local setup

  1. Change directory to Guardian-CLI folder

  2. Build the project by npm run build

  3. Create a symlink to global node modules of machine by npm link

Having cloned Guardian project, Guardian-CLI can be set up for testing by following instructions:

CLI Commands

Here is the commands can be used by Guardian-CLI:

  • Get Version: outputs the current version

    -v, --version

  • Get Help: displays help for command

    -h, --help

Commands:

  • create

Clones Guardian project from repository

  • use

Checks out to a specific version of Guardian project

  • ls

Lists all release versions of Guardian project under the current directory

  • ls-remote

Lists all release versions of Guardian project on official repository

  • build -d --docker, -n --npm, -y --yarn

Build Guardian project under current directory using docker, npm or yarn according to options passed by the command:

  • start -d --docker, -p --pm2

Starts all Guardian services using docker or PM2 runner according to options passed by start command.

  • restart -d --docker, -p --pm2

Restarts all Guardian services using docker or PM2 runner according to options passed by start command.

  • stop -d --docker, -p --pm2

Stops all Guardian services using docker or PM2 runner according to options passed by start command.

  • destroy -d --docker, -p --pm2

Destroy all Guardian services using docker or PM2 runner according to options passed by start command.

  • clean -d --docker, -n --node

Cleans all docker images built if -d or --docker passed as option otherwise if -n or --node selected removes all node_modules and dist folders generated.

Last updated

Was this helpful?