Hook scripts
Yes, hook scripts are fully supported by Tower.
Environment Setup
Tower automatically loads your shell environment by default, making most commands and tools available to your hook scripts. This means hooks should generally work without additional configuration.
If you need to add custom environment variables, you can configure them in Tower Settings → Environment tab. See our environment guide for details.
Working with Version Managers (nvm, rbenv, etc.)
If your hooks use tools managed by version managers like nvm, rbenv, or pyenv and fail with "command not found", this is because Tower can't determine which version should be active for a specific repository. These tools often change the active version based on directory context (e.g., .nvmrc files).
Best Practice: Make your hook scripts self-contained by sourcing the version manager at the start of the script:
#!/bin/sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Your hook logic here
pnpm run lint
This ensures hooks work reliably in Tower, on the command line, in CI/CD, and other Git clients.
Error Messages
If your hook script prints error messages that you want displayed in Tower, make sure the error message is printed to STDERR:
echo "Error!" >&2
Limitations
Interactive scripts that require user input as part of the script are currently not supported in Tower.
Troubleshooting
For detailed troubleshooting steps and debugging techniques, see our hook scripts FAQ.