Overview
Theapplad env command manages environment variables and .env.example generation. Every ${VAR} reference in your yaml files is tracked by Applad. .env.example files are auto-generated and scoped to each level of the org/project hierarchy.
Commands
Generate .env.example
Scans all yaml files in the active project, extracts every${VAR} reference, and generates a .env.example file annotated with which config file uses each variable, what format it expects, and whether it should be treated as a secret.
Run this after adding any new ${VAR} reference to any yaml file.
- Variable names
- Which config files reference each variable
- Expected format/type
- Whether it’s a secret
- Example values (when appropriate)
Validate Environment Variables
Checks that every${VAR} reference in the config tree has a corresponding value set in the environment. Fails with a clear error message naming the missing variable and the exact config file that references it.
applad up runs this automatically on startup — use this to check manually before a deploy.
- All
${VAR}references have corresponding values - Reports missing variables with file locations
- Validates environment-specific variables
Show Environment Diff
Shows the difference between the variables referenced in your config files and what’s actually set in your.env. Highlights variables that are referenced but missing, and variables that are set in .env but not referenced anywhere in the config (potential dead config).
- Variables referenced but not set (missing)
- Variables set but not referenced (unused)
- Environment-specific differences
List Environment Variables
Lists all environment variable keys currently set for the active project. Values are never shown — keys only. This is intentional: secrets should never appear in terminal output.Set Environment Variable
Sets an environment variable for the running instance. Takes effect immediately without requiring a restart.Unset Environment Variable
Removes an environment variable from the running instance.Pull Environment Variables
Pulls the environment variables from the running instance down to a local.env file. Values are included.
Warning: Use with care — the resulting .env file contains real secrets and should never be committed to version control. Applad’s .gitignore excludes .env files automatically.
Push Environment Variables
Pushes your local.env file to the running instance, setting all variables in one operation. Variables not present in the .env file are left unchanged on the instance.
- All variables in
.envare set on the running instance - Existing variables not in
.envremain unchanged - Takes effect immediately without restart
Workflow Examples
Setting up a new environment
Adding a new variable to config
Auditing environment variables
Best Practices
- Never commit .env files: Keep
.envin.gitignore(Applad does this automatically) - Always commit .env.example: Check
.env.exampleinto version control to document required variables - Regenerate after config changes: Run
applad env generateafter adding${VAR}references - Validate before deployment: Run
applad env validatebeforeapplad uporapplad deploy - Use environment-specific validation: Test with
--env productionbefore deploying to production - Document variable purposes: Use
.env.exampleto document what each variable is for
Security Notes
- Variable values are never logged or displayed in terminal output
- Use
applad security secrets setfor highly sensitive values that need encryption at rest - Environment variables are encrypted in transit when using
applad env push/pull - All env changes are recorded in the audit trail with SSH key attribution