Command Line Tools

Rekit provides a set of command line tools to manage components, actions and routing rules for Rekit projects. They are implemented as JavaScript modules in the package rekit-core. Then Rekit just wraps them as command line tools. Actually rekit-core is also used by Rekit Studio.

Create an app

You can use below command to create an app:

rekit create <app-name> [--sass] [--clean]

This will create an app named app-name under the current directory. The flag --sass allows to use sass instead of less as the css transpiler. The flag --clean is used to create a clean project without samples.

Create a plugin

You can use below command to create a plugin:

rekit create-plugin <plugin-name>

It will create a local plugin if the current directory is in a Rekit project, otherwise create a public plugin.

For more information, please read the document at: http://rekit.js.org/docs/plugin.html.

Install a plugin

If you will use a plugin via npm, use the below command:

rekit install <plugin-name>

This will execute install.js script of the plugin to do the initialization and added the plugin name to rekit.plugins section of package.json.

Manage features, components and actions.

This is the key part of daily Rekit development. You will use below commands to mange Rekit elements.

Note: though all commands are put under the rekit command, i.e. rekit add component home/comp1. Actually Rekit will find the local rekit-core package in your app to finish the operation. So execute rekit commands under different Rekit apps may have different behaviors if those apps depends on different versions of rekit-core.

All such commands have similar patterns:

  • rekit add <type>: add an element of the type.
  • rekit mv <type>: move/rename an element of the type.
  • rekit rm <type>: delete an element of the type.

All commands supports [-h] argument to see the usage help. i.e. rekit add -h.

Below is the list of all Rekit commands to manage project elements:

Commands Description
rekit add feature <feature-name> Add a new feature.
rekit mv feature <old-name> <new-name> Rename a feature.
rekit rm feature <feature-name> Delete a feature.
rekit add component <component-name> [-u] [-c] Add a new component.
- `-u`: specify the url pattern of the component. - `-c`: it's a container component connected to Redux store.
rekit mv component <old-name> <new-name> Rename a component.
rekit rm component <component-name> Delete a component.
rekit add action <action-name> [-a] Add a new action.
- `-u`: add an async action.
rekit mv action <old-name> <new-name> Rename an action.
rekit rm action <action-name> Delete an action.

results matching ""

    No results matching ""