> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talosjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# commitlint:init

> Install the git commit-msg hook that lints commit messages against the project's conventional-commit rules.

Installs a git `commit-msg` hook into `.git/hooks/commit-msg` that validates every commit message against the project's conventional-commit rules. It replaces husky and commitlint: the rules live in `@talosjs/cli`, so there is no `.commitlintrc.ts` to maintain. The hook re-invokes the CLI ([`commitlint:check`](/cli/commands/commitlint-check)) to do the check, so it works without a global install. Running it also clears any `core.hooksPath` a previous husky setup left behind, so git uses the standard hooks directory again.

[`app:init`](/cli/commands/app-init) runs this for you, and generated projects re-install the hook on every `bun install` through the `prepare` script. Run it yourself after cloning a repository, or any time the hook goes missing or the repo moves to a new path.

## Usage

```bash theme={null}
talos commitlint:init
```

## Examples

```bash theme={null}
talos commitlint:init
```

## Options

This command takes no options.

## What the hook validates

The installed hook accepts messages in the form `type(scope): Subject`:

* **type** — one of `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`, in lower-case.
* **scope** — required and lower-case, and either `common` or the name of a package or module directory in the workspace. Scopes are discovered automatically, so a new module or package is a valid scope with no config change. Multiple scopes are allowed (`feat(app, shared): ...`).
* **subject** — non-empty, starts with an upper-case letter, and does not end with a period. The whole header must be 100 characters or fewer.

Merge, revert, and autosquash (`fixup!`/`squash!`) messages are ignored. See [`commitlint:check`](/cli/commands/commitlint-check), the command the hook runs to perform the check.
