enx env
Switch between environment configurations.
Table of Contents
- TOC
Usage
enx env [query]
Arguments
| Argument | Required | Description |
|---|---|---|
query |
No | Name (or partial name) of the environment to switch to. If omitted, lists all environments or shows a selector. |
Description
Environments are defined in the [env] section of enx.toml. Each environment maps a name to a dotenv file containing key-value pairs.
When you switch environments, enx records the active environment so that subsequent commands (enx run, enx start, etc.) load the correct environment variables.
Without arguments
If no query is provided, enx displays an interactive fuzzy-select menu of all available environments, or lists them if only a few are defined.
With a query
Fuzzy-matches the query against environment names. If a single match is found, switches to it immediately. If ambiguous, shows a selector.
Examples
$ enx env staging
▸ Matched "staging"
✓ Switched to staging environment
$ enx env
Available environments:
├─ development .env.development
├─ staging .env.staging
└─ production .env.production
See Also
- Configuration:
[env]— defining environments