๐ŸŒต Cactus

July 22, 2025 ยท View on GitHub

Package Version Hex Docs mit gleam js gleam erlang

A tool for managing git lifecycle hooks with โœจ gleam! Pre commit, Pre push and more!

๐Ÿ”ฝ Install

gleam add --dev cactus

๐ŸŒธ Javascript

Bun, Deno & Nodejs are all supported!

๐ŸŽฅ Obligatory VHS

demo

โ–ถ๏ธ Usage

FIRST configure hooks and then run

# initialize configured hooks
# specify the target depending on how you want the hooks to run
gleam run -m cactus

Config

Settings that can be added to your project's gleam.toml

[cactus]
# init hooks on every run (default: false)
always_init = false

# hook name (all git hooks are supported)
[cactus.pre-commit]
# list of actions for the hook
actions = [
    # command: name of the command or binary to be run: required
    # kind: is it a gleam subcommand, a binary or a module: ["sub_command", "binary", "module"], default: module
    # args: additional args to be passed to the command, default: []
    # files: file paths & endings that you want to trigger the action, default: [] (meaning always trigger)

    # check formatting
    { command = "format", kind = "sub_command", args = ["--check"], files = [".gleam", "src/f/oo.gleam"] },
    # run tests
    { command = "./scripts/test.sh", kind = "binary" },
    # check dependencies ๐Ÿ•ต๏ธโ€โ™‚๏ธ
    # self plug of https://github.com/bwireman/go-over
    { command = "go_over", args=["--outdated"] }
]