https://github.com/bwireman/cactus
A tool for managing git lifecycle hooks with ✨ gleam! Pre commit, Pre push and more!
https://github.com/bwireman/cactus
beam cli dx erlang git git-hooks gleam hooks javascript pre-commit pre-commit-hook tools
Last synced: 10 days ago
JSON representation
A tool for managing git lifecycle hooks with ✨ gleam! Pre commit, Pre push and more!
- Host: GitHub
- URL: https://github.com/bwireman/cactus
- Owner: bwireman
- License: mit
- Created: 2024-07-05T15:56:49.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-04-05T15:47:22.000Z (15 days ago)
- Last Synced: 2025-04-10T04:07:10.010Z (10 days ago)
- Topics: beam, cli, dx, erlang, git, git-hooks, gleam, hooks, javascript, pre-commit, pre-commit-hook, tools
- Language: Gleam
- Homepage: https://hex.pm/packages/cactus
- Size: 448 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gleam - cactus - [📚](https://hexdocs.pm/cactus/) - A tool for managing git lifecycle hooks with ✨ gleam! Pre commit, Pre push and more! (Packages / Project Tooling)
README
# 🌵 Cactus
[](https://hex.pm/packages/cactus)
[](https://hexdocs.pm/cactus/)
[](https://github.com/bwireman/cactus/blob/main/LICENSE)
[](https://gleam.run/news/v0.16-gleam-compiles-to-javascript/)
[](https://gleam.run)A tool for managing git lifecycle hooks with ✨ gleam! Pre commit, Pre push and
more!# 🔽 Install
```sh
gleam add --dev cactus
```#### 🌸 Javascript
Bun, Deno & Nodejs are _all_ supported!
### 🎥 Obligatory VHS

# ▶️ Usage
**_FIRST_** configure hooks and then run
```sh
# 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`
```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"] }
]
```