# hyperupcall/autoenv

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hyperupcall-autoenv).**

6,034 stars · 272 forks · Shell · MIT

## Links

- GitHub: https://github.com/hyperupcall/autoenv
- awesome-repositories: https://awesome-repositories.com/repository/hyperupcall-autoenv.md

## Description

autoenv is a directory-based environment manager and shell workflow automator that automatically loads and unloads environment variables and scripts based on the current working directory. It functions as a hierarchical variable loader, applying configuration settings according to the directory hierarchy to isolate project environments.

The utility includes a checksum-based script validator that ensures security by requiring user approval before sourcing detected files. Once a file is authorized, the system remembers the trust setting by verifying file hashes, prompting the user again only if the content changes.

The tool manages the full lifecycle of a shell session by executing setup scripts upon entering a folder and running dedicated cleanup scripts when exiting. It prevents configuration leakage between projects by tracking and unsetting specifically loaded variables and injecting contextual metadata into the shell for use in conditional logic.

## Tags

### Development Tools & Productivity

- [Directory-Triggered Variable Loading](https://awesome-repositories.com/f/development-tools-productivity/environment-variable-management/directory-triggered-variable-loading.md) — Automatically loads and unloads environment variables and executes scripts triggered by directory changes.
- [Hierarchical Loaders](https://awesome-repositories.com/f/development-tools-productivity/environment-variable-loaders/hierarchical-loaders.md) — Applies environment settings according to the directory hierarchy by traversing from the root to the project folder.
- [Directory Exit Script Executions](https://awesome-repositories.com/f/development-tools-productivity/monorepo-managers/directory-exit-script-executions.md) — Executes specific cleanup files upon leaving a directory to purge temporary environment settings. ([source](https://github.com/hyperupcall/autoenv/blob/main/CHANGELOG.md))
- [Project Workflow Automation](https://awesome-repositories.com/f/development-tools-productivity/project-workflow-automation.md) — Automates development setup by loading required secrets and executing project-specific scripts upon directory entry.
- [Shell Context Automations](https://awesome-repositories.com/f/development-tools-productivity/shell-context-automations.md) — Executes setup and cleanup scripts triggered by directory transitions to manage temporary shell resources.
- [Shell Configuration Management](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/configuration-environment-management/shell-configuration-management.md) — Provides a framework for managing nested environment variables and cleanup scripts tied to a local directory hierarchy.
- [Scripting Context Providers](https://awesome-repositories.com/f/development-tools-productivity/build-scripts/scripting-context-providers.md) — Exposes the current directory and sourced file as variables to enable conditional logic within environment scripts. ([source](https://github.com/hyperupcall/autoenv/blob/main/CHANGELOG.md))
- [Checksum Verifiers](https://awesome-repositories.com/f/development-tools-productivity/script-validators/checksum-verifiers.md) — Uses file hashes to remember which environment scripts have been authorized by the user.
- [Trust Validation](https://awesome-repositories.com/f/development-tools-productivity/shell-script-execution-engines/trust-validation.md) — Implements a security layer that requires user approval for scripts based on checksum verification.

### Data & Databases

- [Environment State Restorers](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-operations/sql-query-execution/history-tracking/variable-state-tracking/environment-state-restorers.md) — Tracks loaded variables to restore the previous shell state and prevent configuration leakage between projects.

### Software Engineering & Architecture

- [Environment Variable Scrubbers](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/environment-variable-management/environment-variables/environment-variable-based-configuration/environment-variable-scrubbers.md) — Automatically removes shell variables when leaving a directory to maintain strict isolation between project environments. ([source](https://github.com/hyperupcall/autoenv#readme))
- [Project-Specific Shell Isolation](https://awesome-repositories.com/f/software-engineering-architecture/environment-isolation/project-specific-shell-isolation.md) — Isolates project configurations by managing distinct shell variables based on the current working directory. ([source](https://github.com/hyperupcall/autoenv/blob/main/package.json))
- [Shell Configuration Isolators](https://awesome-repositories.com/f/software-engineering-architecture/environment-isolation/shell-configuration-isolators.md) — Prevents configuration leakage between projects by tracking and unsetting shell variables when leaving a directory.
- [Directory Transition](https://awesome-repositories.com/f/software-engineering-architecture/function-execution-engines/cleanup-hooks/directory-transition.md) — Runs dedicated cleanup scripts upon exiting directories to remove temporary variables and tear down resources.
- [Hierarchical Configuration Systems](https://awesome-repositories.com/f/software-engineering-architecture/hierarchical-configuration-systems.md) — Manages nested environment variables that apply settings based on the directory position in the filesystem.
- [Hierarchical Configuration Lookups](https://awesome-repositories.com/f/software-engineering-architecture/source-file-organization/source-root-configurators/hierarchical-configuration-lookups.md) — Traverses the directory hierarchy from root to project folder to source nested environment configurations.

### Business & Productivity Software

- [Dynamic Variable Injection](https://awesome-repositories.com/f/business-productivity-software/share-link-generation/proxy-subscription-links/dynamic-variable-injection.md) — Provides dynamic variable injection into the shell session based on the current working directory.

### DevOps & Infrastructure

- [Trusted Environment Loaders](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-file-loading/environment-file-loaders/trusted-environment-loaders.md) — Requires user confirmation and verifies file hashes before sourcing detected environment files. ([source](https://github.com/hyperupcall/autoenv#readme))

### Operating Systems & Systems Programming

- [Shell Environment Automators](https://awesome-repositories.com/f/operating-systems-systems-programming/terminal-command-line-environments/shells-scripting/configuration-scripts/shell-environment-automators.md) — Executes dedicated setup and cleanup scripts automatically upon entering or exiting project folders.

### Programming Languages & Runtimes

- [Shell Environment Injections](https://awesome-repositories.com/f/programming-languages-runtimes/shell-functions/shell-environment-injections.md) — Injects dynamic metadata about paths and scripts into the shell environment to facilitate conditional logic.

### Security & Cryptography

- [Script Integrity Validators](https://awesome-repositories.com/f/security-cryptography/identity-servers/certificate-trust-validation/configuration-trust-validators/script-integrity-validators.md) — Implements a checksum-based validator to ensure shell scripts are authorized and untampered before being sourced.

### Part of an Awesome List

- [Shell Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/shell-frameworks.md) — Manages environment variables based on the current directory.
- [Terminal Productivity](https://awesome-repositories.com/f/awesome-lists/devtools/terminal-productivity.md) — Directory-based environment variable management.
