Skip to Content
Env ValidationOverview

Env Validation

miso env validates environment variables from your .env files against rules defined in miso.json.

Usage

miso env

Or use --env as a flag behind other commands to validate before running:

miso dev --env miso build --env
  • With env config: Loads each configured .env file, validates its variables, and prints success or the first error.
  • Without env config: Uses discovery to find a .env file in the project root.
  • Empty variables: Succeeds—nothing to validate.

Quick Start

  1. Add an env array to miso.json, with one entry per app or .env file:
{ "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"] } } } ] }
  1. Run miso env before starting your app (or in CI):
miso env && miso dev

Each entry is validated independently. If a variable fails in the api entry, the error will say so:

api: missing required variable: REDIS_URL

Next Steps

  • Configure labels, paths, required variables, and validation rules
  • See the Types & VarConfig reference for all supported types and options
Last updated on