Env Validation
miso env validates environment variables from your .env files against rules defined in miso.json.
Usage
miso envOr use --env as a flag behind other commands to validate before running:
miso dev --env
miso build --env- With env config: Loads each configured
.envfile, validates its variables, and prints success or the first error. - Without env config: Uses discovery to find a
.envfile in the project root. - Empty variables: Succeeds—nothing to validate.
Quick Start
- Add an
envarray tomiso.json, with one entry per app or.envfile:
{
"env": [
{
"label": "web",
"path": "apps/web/.env.local",
"variables": {
"PORT": "port",
"DATABASE_URL": "url"
}
},
{
"label": "api",
"path": "apps/api/.env",
"variables": {
"REDIS_URL": {
"type": "url",
"schemes": ["redis", "rediss"]
}
}
}
]
}- Run
miso envbefore starting your app (or in CI):
miso env && miso devEach entry is validated independently. If a variable fails in the api entry, the error will say so:
api: missing required variable: REDIS_URLNext Steps
- Configure labels, paths, required variables, and validation rules
- See the Types & VarConfig reference for all supported types and options
Last updated on