Guide
Learn how to install and interact with Rehooks CLI.
Installation
To use the CLI, you can execute it directly with the latest version:
Guide
At first, you must initialize
the Rehooks configuration. To do this, run the following command:
If your project includes a src
directory, you must select yes whenever you use init
.
It will create a rehooks.json
in the root of your project. This file contains the directory where the hooks will be imported.
If you want to use a custom path for the hooks directory, you can pass it as
an argument to the init
command.
Now It's time to add hooks into your codebase. To achieve this you must use the add
command.
This command will ask you to select the hooks you want to add. You can select multiple hooks by pressing the space
key.
Usage
Options
These are the options available in the CLI.
Option | Description |
---|---|
-v, --version | Displays the version number |
-h, --help | Displays help for command |
Commands
Command | Description |
---|---|
init [options] [path] | Initialize the Rehooks configuration |
add [options] | Add custom hooks to your codebase |
help [command] | Displays help for a specific command |
Init
Option | Description |
---|---|
-f, --force | Force overwrite existing configuration without prompt |
-c, --config <path> | Specify a custom path for rehooks.json |
-h, --help | Displays help for command |
Add
Option | Description |
---|---|
-f, --force | Force overwrite existing hook files without prompt |
-h, --help | Displays help for command |