Repository navigation
Actions And Git Hooks
An action is a command that rtunk runs on demand or when a git event fires, such as pre-commit.
List actions with rtunk actions list, enable them, then install the hooks with
rtunk git-hooks sync.
$ rtunk actions enable trunk-check-pre-commit
$ rtunk git-hooks sync
installed: pre-commit$ rtunk actions list
Available (not enabled)
◯ buf-gen Run 'buf generate' anytime a .proto file changes. ...
◯ commitlint Enforce git commit message standards
◯ go-mod-tidy Runs go mod tidy when changes are detected to go.mod
...
Enable one with: rtunk actions enable <id>Actions are grouped as Enabled and Available (not enabled). --format json prints the same
data as JSON.
rtunk actions enable trunk-check-pre-commit go-mod-tidy
rtunk actions disable go-mod-tidyBoth commands edit .rtunk/rtunk.yaml. Disabling moves the id from actions.enabled to
actions.disabled:
actions:
enabled:
- trunk-check-pre-commit
disabled:
- go-mod-tidyAs with linters, rtunk actions enable without ids opens the same full-screen interactive picker (terminal only; type to filter, space toggles, enter confirms, esc or ctrl-c cancels).
rtunk git-hooks sync writes a hook script into .git/hooks/ for every git hook that an enabled
action triggers. The script calls back into rtunk (rtunk actions run --hook <hook>), so a hook
runs every enabled action bound to it.
$ rtunk git-hooks sync
installed: pre-commit
$ rtunk git-hooks unsync
removed: pre-commitsync is idempotent: running it again rewrites the same files. unsync removes only hooks that
rtunk installed.
Note
rtunk never overwrites a hook it did not write. sync prints skipped (foreign hook, use --force): pre-commit and leaves the file alone; add --force to replace it.
The hook script embeds the path of the rtunk binary that ran sync. Re-run sync after moving or
reinstalling rtunk.
Run one action by id, or every action a git hook triggers:
rtunk actions run trunk-announce
rtunk run trunk-announce
rtunk run --hook pre-commitrtunk run is a shortcut for rtunk actions run. Arguments after -- are forwarded to the
action. Only enabled actions run: rtunk run go-mod-tidy fails with unknown action "go-mod-tidy" while that action is disabled. A failing action makes the command fail:
$ rtunk run trunk-announce
rtunk: actions: trunk-announce: exit code 109$ rtunk actions history
2026-10-01T09:40:18+02:00 trunk-check-pre-commit pre-commit exit 1 434ms
2026-10-01T09:40:17+02:00 trunk-announce manual exit 109 535msEach line shows the time, the action, what triggered it (manual or the git hook), the exit code
and the duration. Filter with --id <action-id> and cap the output with --limit (default 20).
-
Command Reference — every flag of
actions,runandgit-hooks - Cache And Logs — where run logs are stored
- Managing Linters — the same enable and disable workflow for linters
Home · FAQ · Report an issue ·
Source of this page: docs/ in the rtunk repository
Getting started
Using rtunk
- Checking code
- Formatting code
- Ignoring issues
- Managing linters
- Actions and git hooks
- Keeping tools up to date
- Cache and logs
- GitHub Action
Reference
Internals