1.0.0-alpha • Published 7 years ago

kakle v1.0.0-alpha

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

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

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:

⇝ 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:

⇝ 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

kakle add tag
> tag: <>
> command: <>
> autorun: true|false
kakle add regex
> regex: <>
> command: <>
> autorun: true|false
kakle add glob
> glob: <>
> command: <>
> autorun: true|false

Hooks

kakle hooks activate
kakle hooks deactivate
kakle hooks status

List

kakle list
# List all tags/regex/globs

Executing

kakle exec ./path/to/.kaklerc