# toddbluhm/env-cmd

**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/toddbluhm-env-cmd).**

1,818 stars · 68 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/toddbluhm/env-cmd
- Homepage: https://www.npmjs.com/package/env-cmd
- awesome-repositories: https://awesome-repositories.com/repository/toddbluhm-env-cmd.md

## Topics

`command-line-tool` `cross-platform` `environment-variables` `environments` `nodejs` `typescript` `utilities` `variables`

## Description

This project is a command-line utility that executes processes by injecting environment variables from local configuration files. It functions as a runtime wrapper, allowing developers to manage application settings and process execution contexts without modifying global system variables.

The tool distinguishes itself by supporting dynamic configuration loading, which allows for the use of files that export objects or promises to compute values at runtime. It provides granular control over environment management, including the ability to group variables into named collections, protect existing environment variables from being overwritten, and handle missing configuration files gracefully.

Beyond basic injection, the utility facilitates cross-platform script execution and automated build pipeline management by replacing placeholders within command arguments with resolved environment values. It creates isolated child processes to ensure that configuration settings remain scoped to specific tasks, maintaining consistent behavior across different development and deployment environments.

## Tags

### Development Tools & Productivity

- [Shell Command Runners](https://awesome-repositories.com/f/development-tools-productivity/shell-command-runners.md) — Acts as a runtime wrapper that applies file-based environment settings to shell commands without modifying global system variables.
- [Environment Variable Loaders](https://awesome-repositories.com/f/development-tools-productivity/environment-variable-loaders.md) — Executes processes with environment variables injected from local configuration files.
- [Cross-Platform Script Runners](https://awesome-repositories.com/f/development-tools-productivity/cross-platform-script-runners.md) — Runs shell commands with injected environment variables to maintain consistent application behavior across different operating systems and deployment environments.
- [Command Argument Resolvers](https://awesome-repositories.com/f/development-tools-productivity/dynamic-command-resolution/command-argument-resolvers.md) — Scans command-line arguments for variable tokens and replaces them with resolved values from the environment before the process starts.
- [Dynamic Module Loading](https://awesome-repositories.com/f/development-tools-productivity/dynamic-module-loading.md) — Imports configuration files as executable code to support computed values and asynchronous data fetching during the environment setup phase.
- [Dynamic Configuration Loaders](https://awesome-repositories.com/f/development-tools-productivity/external-configuration-loading/dynamic-theme-loading/dynamic-configuration-loaders.md) — Supports importing environment variables from files that export objects or promises, enabling computed values and dynamic settings. ([source](https://github.com/toddbluhm/env-cmd/blob/master/README.md))
- [Node.js Process Management](https://awesome-repositories.com/f/development-tools-productivity/node-js-process-management.md) — Manages environment-specific configurations and process execution contexts within Node.js development and deployment workflows.
- [Shell Command Execution](https://awesome-repositories.com/f/development-tools-productivity/shell-command-execution.md) — Creates a new operating system process to run commands within a modified environment context that persists for the duration of the task.
- [Build and Task Automation](https://awesome-repositories.com/f/development-tools-productivity/workflow-automation-tools/build-task-automation.md) — Executes build and deployment tasks with dynamic environment variables to ensure consistent behavior across different development and production stages.

### DevOps & Infrastructure

- [Runtime Environment Variable Injections](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/environment-management/environment-variable-management/environment-variable-configurations/environment-variable-configuration/runtime-environment-variable-injections.md) — Injects configuration variables into a child process environment before executing a command to isolate settings from the parent shell.
- [File-Based Configurations](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/environment-management/environment-variable-management/environment-variable-configurations/environment-variable-configuration/file-based-configurations.md) — Reads and transforms external text or script files into structured key-value pairs for dynamic environment variable assignment.

### Software Engineering & Architecture

- [Application Configuration](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-scopes/application-configuration.md) — Loads structured environment settings into application processes to manage secrets and dynamic parameters without hardcoding values into the source code.
- [Environment Variable Managers](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/environment-variable-management/environment-variable-managers.md) — Injects configuration from files into shell processes to support environment-specific settings without modifying global system variables.
- [Scoped Environment Variable Injections](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/environment-variable-management/environment-variables/scoped-environment-variable-injections.md) — Applies specific environment variables from designated files before command execution to support environment-specific configurations. ([source](https://github.com/toddbluhm/env-cmd#readme))

### Content Management & Publishing

- [Dynamic Placeholder Expansion](https://awesome-repositories.com/f/content-management-publishing/dynamic-placeholder-expansion.md) — Replaces placeholders within command arguments with actual environment variable values at runtime. ([source](https://github.com/toddbluhm/env-cmd/blob/master/README.md))
