Tego is a minimal, declarative Git hooks manager that works with any programming language. It provides a simple, configuration-based approach to managing Git hooks without requiring manual script management or complex setup procedures.
Tego is built as a single native binary written in Go, offering fast execution and zero runtime dependencies. Unlike language-specific tools, Tego can be used in projects regardless of their technology stack—JavaScript, Python, Ruby, Go, Rust, PHP, or any other language.
- Universal Language Support - Works with any programming language or framework
- Simple Configuration - Define hooks using JSON, TOML, or YAML
- Native Performance - Single binary with no runtime dependencies
- Explicit Installation - Manual hook installation with no magic scripts
- Multiple Commands - Run multiple commands per hook sequentially
- Standard Git Hooks - Supports all standard Git hook types
curl -L https://github.com/Veri5ied/tego/releases/download/v1.0.0/tego-1.0.0-darwin-arm64.tar.gz | tar xz
sudo mv tego /usr/local/bin/curl -L https://github.com/Veri5ied/tego/releases/download/v1.0.0/tego-1.0.0-darwin-x86_64.tar.gz | tar xz
sudo mv tego /usr/local/bin/curl -L https://github.com/Veri5ied/tego/releases/download/v1.0.0/tego-1.0.0-linux-x86_64.tar.gz | tar xz
sudo mv tego /usr/local/bin/Download tego-1.0.0-windows-x86_64.tar.gz, extract, and add to PATH.
Initialize Tego in your project:
tego initThis creates a .tegorc.json file with sample configuration.
Edit the configuration file to define your hooks:
{
"hooks": {
"pre-commit": "npm run lint && npm test",
"commit-msg": "npx commitlint --edit $1",
"pre-push": "npm run build"
}
}Install the hooks:
tego installThe hooks are now active and will run automatically during Git operations.
Tego looks for configuration files in the following order:
.tegorc.json.tegorctego.jsontego.tomltego.yamltego.yml
{
"hooks": {
"pre-commit": "npm test",
"pre-push": "npm run lint"
}
}[hooks]
pre-commit = "npm test"
pre-push = "npm run lint"hooks:
pre-commit: npm test
pre-push: npm run lintYou can define multiple commands for a single hook:
{
"hooks": {
"pre-commit": ["npm run format", "npm run lint", "npm test"]
}
}Commands are executed sequentially. If any command fails, the Git operation is aborted.
Create a sample configuration file:
tego initInstall configured hooks to .git/hooks:
tego installRemove Tego-managed hooks:
tego uninstallDisplay all configured hooks:
tego listManually execute a specific hook:
tego run pre-commitDisplay version information:
tego versionTego supports all standard Git hooks:
pre-commit- Runs before a commit is createdprepare-commit-msg- Runs before the commit message editor is openedcommit-msg- Validates or modifies the commit messagepost-commit- Runs after a commit is createdpre-push- Runs before pushing to a remotepre-rebase- Runs before a rebase operationpost-merge- Runs after a merge operationpost-checkout- Runs after checking out a branch
And many others supported by Git.
.tegorc.json:
{
"hooks": {
"pre-commit": ["npm run lint", "npm run format", "npm test"],
"commit-msg": "npx commitlint --edit $1",
"pre-push": "npm run build"
}
}.tegorc.json:
{
"hooks": {
"pre-commit": "black . && pylint src/",
"pre-push": "pytest"
}
}.tegorc.json:
{
"hooks": {
"pre-commit": ["go fmt ./...", "go vet ./...", "go test ./..."],
"pre-push": "go test -race ./..."
}
}.tegorc.json:
{
"hooks": {
"pre-commit": [
"cd packages/frontend && npm run lint",
"cd packages/backend && npm run lint",
"npm test"
]
}
}To skip hooks for a specific Git operation, set the TEGO_SKIP environment variable:
TEGO_SKIP=1 git commit -m "skip hooks for this commit"On Windows:
set TEGO_SKIP=1 && git commit -m "skip hooks for this commit"When you run tego install, Tego creates shell scripts in .git/hooks/ that delegate to the tego run command. For example, the pre-commit hook becomes:
#!/bin/sh
# Installed by Tego
tego run pre-commit "$@"When Git triggers the hook, Tego reads your configuration file and executes the defined commands. If any command fails, the Git operation is aborted.
Commit your configuration file (.tegorc.json) to version control. Team members can then install hooks by running:
tego installThis ensures all team members use the same hooks and maintain consistent code quality standards.
Tego is designed with the following principles:
- Language Agnostic - Should work seamlessly in any project, regardless of programming language
- Explicit over Magic - Hook installation is a deliberate action, not an automatic side effect
- Configuration as Code - Use structured configuration files (JSON, TOML, YAML) rather than executable scripts
- Zero Dependencies - No runtime requirements beyond Git itself
- Performance First - Native binary execution for fast hook processing
- Git 2.0 or higher
- Unix-like shell (Linux, macOS, WSL, Git Bash on Windows)
Contributions are welcome. Please open an issue or submit a pull request on GitHub.
MIT License. See LICENSE file for details.
Inspired by Husky and other Git hooks management tools, Tego aims to provide a universal solution that works across all programming languages and environments.