-
Notifications
You must be signed in to change notification settings - Fork 0
direnv setup
github-actions[bot] edited this page Apr 29, 2025
·
1 revision
This project uses direnv to automatically set up your development environment when you enter the project directory.
Direnv is a shell extension that loads environment variables from a .envrc file when you enter a directory. It automatically:
- Activates the Python virtual environment
- Sets up environment variables for the project
- Adds project scripts to your PATH
- Sets up database connection variables
brew install direnvsudo apt-get install direnvsudo pacman -S direnvAdd the following to your shell configuration file (.bashrc, .zshrc, etc.):
# For bash
eval "$(direnv hook bash)"
# For zsh
eval "$(direnv hook zsh)"
# For fish
direnv hook fish | sourceThen restart your shell or source your configuration file.
-
Navigate to the Teko project directory:
cd /path/to/teko -
The first time you enter the directory, you'll need to allow direnv to load the
.envrcfile:direnv allow
-
Now whenever you navigate to the project directory, direnv will automatically:
- Activate the Python virtual environment
- Add project scripts to your PATH
- Set up environment variables
- Configure database connections
The .envrc file:
- Activates the Python virtual environment in
agents/.venv - Creates the virtual environment if it doesn't exist
- Sets up environment variables for database connections
- Adds
scripts/andvendor/bin/to your PATH - Loads variables from
.env(if it exists) for override values