Quick Start¶
This walkthrough creates one configuration, validates it, and runs a command with the resolved variables.
Install dotenv-fusion first if needed:
Other installation methods are listed on the Installation page.
1. Create .env-fuse¶
.env-fuse
ENV=${ENV:-development}
APP_NAME=my-application
#@def PORT type=int default=8000 min=1 max=65535 doc="HTTP listening port"
PORT=8000
#@if ${ENV} == production
LOG_LEVEL=warning
#@else
LOG_LEVEL=debug
#@endif
BASE_URL=http://localhost:${PORT}
The file remains readable as dotenv syntax. Directives start with #@, so tools that do not understand them still see comments.
2. Validate it¶
check validates directives, expansion, conditions, types, required values, and regular expressions without changing the shell or writing an output file.
3. Run a command¶
The command receives:
Select another environment with a build-time variable:
Choose the delivery method¶
| Goal | Command | Guide |
|---|---|---|
| Start one process | dotenv-fusion exec -- COMMAND | Run an Application |
| Update the current shell | eval "$(dotenv-fusion load)" | Load Variables into Your Shell |
| Create a flat dotenv file | dotenv-fusion fuse -o .env | Generate a .env File |