Intelligent git hooks with dependency tracking
Built-in caching. Dependency-aware testing. Multi-language support.
- Dependency-aware — Only runs tests affected by your changes
- Smart caching — Skips unchanged tests automatically
- Multi-language — Supports Go, TypeScript, JavaScript, and Python
- Zero dependencies — Single binary, no runtime required
- Beautiful TUI — Real-time test execution with visual feedback
OctoHook builds a dependency graph of your project by analyzing imports across your codebase. When you commit changes, it:
- Identifies which files were modified
- Traces their dependencies to find affected code
- Runs only the tests that matter
- Caches results to skip redundant test runs
This means faster commits and more confidence that you're testing what actually changed.
# Download the latest release
# Coming soon
# Or build from source
go build -o octohook cmd/main.go
# Install hooks in your project
./octohook installCreate an octohook.yml file in your project root:
pre-commit:
command: npm
arg: ["test"]
path:
services:
- "src/**/*.ts"
test:
- "src/**/*.spec.ts"
cache: true
use_directory: falsecommand: The executable to run (e.g.,npm,go,pytest)arg: Arguments passed to the commandpath.services: Glob patterns for source filespath.test: Glob patterns for test filescache: Enable/disable result caching (default: true)use_directory: Pass directory instead of file path (useful for Go)
TypeScript/JavaScript:
pre-commit:
command: npm
arg: ["test"]
path:
services: ["**/*.ts"]
test: ["**/*.spec.ts"]Go:
pre-commit:
command: go
arg: ["test"]
path:
services: ["**/*.go"]
test: ["**/*_test.go"]
use_directory: truePython:
pre-commit:
command: pytest
arg: []
path:
services: ["**/*.py"]
test: ["**/test_*.py"]pre-commit— Runs before commit is createdpost-commit— Runs after commit is createdpre-push— Runs before pushing to remotepost-push— Runs after pushing to remote
octohook install # Install all configured hooks
octohook uninstall # Remove all hooks
octohook uninstall-hook # Remove a specific hook
octohook pre-commit # Run pre-commit hook manually
octohook post-commit # Run post-commit hook manually
octohook pre-push # Run pre-push hook manually
octohook post-push # Run post-push hook manuallyOctoHook parses your codebase to understand import relationships, building a reverse dependency graph that tracks which files depend on others.
Instead of running all tests, OctoHook identifies:
- Tests directly affected by changed files
- Tests in the same directory as changed files
- Tests for files that import your changes
Results are cached using SHA-256 hashes of file contents. If neither the test nor its related source files have changed, the test is skipped.
Built with Bubble Tea, the terminal interface shows test progress with spinners, status indicators, and immediate feedback on failures.
- Core hook execution engine
- Dependency graph analysis
- Intelligent cache system
- Basic multi-language support (Go, TS, JS, Python)
- TUI with real-time feedback
- Hook installation/uninstallation
- Installation script
- Improve dependency graph system
- Interactive init command for configuration
- npx-based installation
- Extended language support
- Comprehensive testing suite
- Test in production projects
- Pre-built binaries for all platforms
MIT