# kakle

> > If Commit Then That

Latest version **1.0.0-alpha** (published 2017-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install kakle
pnpm add kakle
yarn add kakle
bun add kakle
```

Provides the command `kakle`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha |
| Published | 2017-10-21 |
| First published | 2017-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | Mikael Brevik |
| Maintainers | mikaelb |

## Links

- npm: https://www.npmjs.com/package/kakle
- npm.io page: https://npm.io/package/kakle

## Dependencies (8)

- [rc](https://npm.io/package/rc.md) ^1.1.6
- [chalk](https://npm.io/package/chalk.md) ^2.2.0
- [marked](https://npm.io/package/marked.md) ^0.3.5
- [inquirer](https://npm.io/package/inquirer.md) ^3.3.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.0
- [run-parallel](https://npm.io/package/run-parallel.md) ^1.1.4
- [marked-terminal](https://npm.io/package/marked-terminal.md) ^2.0.0

## Recent versions

- 1.0.0-alpha (latest) — 2017-10-21
- 1.0.0-beta (beta) — 2017-10-21

## README

# kakle

> If Commit Then That

When working on big or small teams, there comes a time when one of your team members adds a frontend dependency, adds code that requires database migration, or just adds a patch that simply requires you to run a command. `kakle` does exactly this. If some file is changed, run a command. If a commit message contains a tag, run a command. If you don't want to automatically run commands, you can just get a reminder that you should do it your self. `kakle` can be summarized as `If Commit, Then That`.

See more documentation in the [docs](./docs)

## Example Usage

`kakle` uses a local config file (`.kaklerc`) in your repo which you can use to add hooks for commits. Or you can use the CLI to add interactively:

```shell
⇝ kakle add
? type (tag, regex or glob) glob
? glob package.json
? command npm install
? should run automatically Yes

{
  "glob": "package.json",
  "command": "npm install",
  "autorun": true
}

? Does this look good? Yes
√ Added new hook
```

This adds a `tag hook` to your git messages, and when you merge in or rebase in a new commit with the text `[run]` in the message, the command `curl http://localhost:3000` will automatically run – given that you have activated the kakle hooks. You can check this by doing:

```shell
⇝ kakle hooks status
Hooks not yet activated.
Run `kakle hooks activate` to activate hooks.
```

and activate it by doing:

```
⇝ kakle hooks activate
Activated hooks
```

See other commands by doing `kakle help` or help on a specific topic by doing `kakle help <topic>` (e.g. `kakle help hooks`).

# Usage

```
⇝ kakle -h

Usage: kakle [options] <sub-task>


Commands:

  hooks <command>     activate, deactivate or show current status of git hooks in a repo
  exec <manifest>     execute kakle on manifestfile (mostly used by hooks)
  add [hook-type]     Add tags, regexes and/or globs
  remove [hook-type]  Remove tags, regexes and/or globs
  list [hook-type]    List different tags, regexes and/or globs
  help [cmd]          display help for [cmd]

# Kakle
When working on big or small teams, there comes a time when one of your team
members adds a frontend dependency, adds code that requires database migration,
or just adds a patch that simply requires you to run a command. kakle does
exactly this. If some file is changed, run a command. If a commit message
contains a tag, run a command. If you don't want to automatically run commands,
you can just get a reminder that you should do it your self. kakle can be
summarized as If Commit, Then That.

Options:

  -h, --help     output usage information
  -V, --version  output the version number

```

# Examples

## Adding

```shell
kakle add tag
> tag: <>
> command: <>
> autorun: true|false
```

```shell
kakle add regex
> regex: <>
> command: <>
> autorun: true|false
```

```shell
kakle add glob
> glob: <>
> command: <>
> autorun: true|false
```

## Hooks

```shell
kakle hooks activate
```

```shell
kakle hooks deactivate
```

```shell
kakle hooks status
```

## List

```shell
kakle list
# List all tags/regex/globs
```


## Executing

```shell
kakle exec ./path/to/.kaklerc
```

---
_Source: https://npm.io/package/kakle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
