Rehooks

Guide

Learn how to install and interact with Rehooks CLI.

Installation

To use the CLI, you can execute it directly with the latest version:

Terminal
npx rehooks-cli@latest

Guide

At first, you must initialize the Rehooks configuration. To do this, run the following command:

Terminal
npx rehooks-cli init

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.

Terminal
npx rehooks-cli add

This command will ask you to select the hooks you want to add. You can select multiple hooks by pressing the space key.

Usage

Terminal
npx rehooks-cli [options] [command]

Options

These are the options available in the CLI.

OptionDescription
-v, --versionDisplays the version number
-h, --helpDisplays help for command

Commands

CommandDescription
init [options] [path]Initialize the Rehooks configuration
add [options]Add custom hooks to your codebase
help [command]Displays help for a specific command

Init

OptionDescription
-f, --forceForce overwrite existing configuration without prompt
-c, --config <path>Specify a custom path for rehooks.json
-h, --helpDisplays help for command

Add

OptionDescription
-f, --forceForce overwrite existing hook files without prompt
-h, --helpDisplays help for command

On this page