Skip to main content
The discover command scans your source code for environment variable usage and suggests additions to your .preflight.yaml schema. This is the fastest way to sync your configuration with your code.

Usage

dotset preflight discover [options]

Options

OptionDescription
-s, --schema <path>Path to your existing schema file
--fixAutomatically add discovered variables to the schema

How it works

Preflight performs a static analysis of your source code to find common patterns of environment variable access:
  • JavaScript/TypeScript: process.env.VAR or process.env['VAR']
  • Python: os.environ.get("VAR") or os.getenv("VAR")
  • Go: os.Getenv("VAR")

Automatic Syncing

If you run with the --fix flag, Preflight will append any missing variables to your .preflight.yaml with a default type of string and a description indicating it was discovered in the code.
dotset preflight discover --fix
[!TIP] Run discover --fix as part of your local pre-commit hook or developer setup script to ensure the environment schema never drifts from the codebase.