Skip to main content

FrontHub CLI

The FrontHub CLI is a task runner. Before to use the commands below you'll need to install the front-hub-cli globally or using npx.

Using Globally

You can run front-hub without any arguments to see the help.

front-hub

With NPX

npx @resultadosdigitais/front-hub-cli

(npx comes with npm 5.2+ and higher)

OptionDescription
-V, --versionOutput the version number
-h, --helpDisplay help for command

init

This command is meant to be executed in a blank git repository, if you are migrating from a create react app, please follow instructions from "Migrating my create react app to FrontHub".

In a blank git repository type

front-hub init [options] <project-directory>
OptionDescription
-y, --yesRuns with default config
-h, --helpDisplay help for command

For extra configurations use the front-hub.config.js.

create package

Creates a package in FrontHub project.

front-hub create package [options] <package-directory-name> [project-directory]
OptionDescription
-y, --yesRuns with default config
-h, --helpDisplay help for command

Example:

cd my-monorepo
front-hub create package my-microfrontend

This command will generate my-microfrontend with all FrontHub configuration inside of packages directory:

my-monorepo/
packages/
my-microfrontend/

For extra configurations use the front-hub.config.js.

clear

Clear cache and temporary files of front-hub.

front-hub clear
OptionDescription
-h, --helpDisplay help for command

fake

api

Creates a fake FrontHub api. To learn more about this feature, use the Fake API instructions

front-hub fake api [options]
OptionDescription
-L, --noLernaRun in repositories without lerna
-p, --portSpecifies the port where the service is listening. (default: 5000)
-h, --helpDisplay help for command

repository

Creates a fake FrontHub repository. To learn more about this feature, use the Fake Repository instructions

front-hub fake repository [options]
OptionDescription
-p, --portSpecifies the port where the service is listening. (default: 3001)
-h, --helpDisplay help for command