Automatically source environment variables and run commands when entering or leaving directories via .env files.
Autoenv is a shell utility that automatically sources environment files when you navigate into or out of directories. It solves the problem of manually activating project-specific settings, virtual environments, or environment variables each time you switch between projects in the terminal.
Developers and system administrators who work in shell environments and manage multiple projects with distinct configurations, such as Python virtualenvs or custom environment variables.
It eliminates repetitive manual steps, reduces human error, and streamlines workflow by automating environment setup and teardown based on directory changes.
Directory-based environments.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Executes .env files upon entering directories, eliminating manual steps for setting up project-specific environments like virtualenvs, as shown in the usage example with 'echo whoa'.
Walks up directory hierarchies to source all relevant .env files, allowing layered environment setups across parent and child directories without duplication.
Offers environment variables like AUTOENV_ENABLE_LEAVE and AUTOENV_VIEWER for configurable behavior, enabling features such as automatic deactivation and file viewing.
Tested and works with Bash, Zsh, and Dash, with Fish support via a separate plugin, covering most popular shell environments for developers.
Autoenv overrides the cd command by default (unless AUTOENV_PRESERVE_CD is set), which can conflict with user-defined cd functions or aliases, requiring unaliasing or custom adjustments as noted in the Disclaimer.
Requires manual authorization for new .env files by default, adding friction; if AUTOENV_ASSUME_YES is set, it risks executing untrusted scripts automatically in shared directories.
Manual installation involves editing shell startup files (.bashrc, .zshrc, etc.), which can be error-prone and break existing configurations, especially for users unfamiliar with shell profiling.