Before every commit
The easiest way to keep a secret out of git is to check before it’s committed. Run this once from the root of your repository:
uvx gglint hookgglint looks for the hook tool you already use. With husky or plain git hooks, it adds the check
to your pre-commit hook. With pre-commit, lefthook or lint-staged, it prints the lines to paste
into their config. It never overwrites an existing hook, and running it twice does nothing the
second time. Add --with-mcp to check MCP servers on each commit too.
In a JavaScript project, it also adds @gglint/cli to your dev dependencies, so the hook works
for everyone who runs npm install. Anywhere else, the hook runs gglint through uvx, so whoever
commits needs uv.
With pre-commit
Section titled “With pre-commit”If you use pre-commit or prek, add
gglint to .pre-commit-config.yaml. It installs gglint by itself, so nobody needs uv or Node.
repos: - repo: https://github.com/corridor/gglint-pre-commit rev: v0.5.1 hooks: - id: gglint-secretsrepos: - repo: https://github.com/corridor/gglint-pre-commit rev: v0.5.1 hooks: - id: gglint-secrets - id: gglint-mcppre-commit autoupdate picks up new releases.