envtrap run
The primary command. Spawns your application as a monitored child process.
Arguments
Options
How envtrap run works
- Loads
envtrap.jsonfrom CWD (if present) and applies defaults for missing fields - Loads secrets from
process.env(minus system variable blocklist) and the.envfile - Starts the in-memory MITM TLS proxy (unless
--no-mitmorchannels.network: "off") - Builds the child process environment: adds
HTTP_PROXY,HTTPS_PROXY,NODE_EXTRA_CA_CERTS,NODE_OPTIONS(with--import hooks.mjs), and internal envtrap env vars - Spawns the child with
stdio: ['inherit', 'pipe', 'pipe'] - Pipes and scans stdout/stderr in real time
- On child exit: prints summary, writes
.envtrap-report.json, removes system CA
Examples
Basic:envtrap check
Validates envtrap.json in the current working directory and reports any schema errors.
envtrap.json, validates every field against the expected schema, and prints a human-readable report.
Valid configuration:
0— Config is valid (or no config file exists)1— Config file has validation errors
Internal Environment Variables
envtrap passes the following variables to the child process. These are read byhooks.mjs and should not be set manually:
