code_env
code_env shows where an environment variable is defined (.env, docker-compose.yml, Dockerfile) and every place in the codebase that reads it (process.env.X, os.environ["X"]).
code_env(name="DATABASE_URL")code_env(name="STRIPE_SECRET_KEY")code_env()Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | — | Environment variable name; omit to list all |
Output
Section titled “Output”DATABASE_URL
Defined in: .env.example DATABASE_URL=postgres://localhost:5432/myapp docker-compose.yml DATABASE_URL=postgres://db:5432/myapp
Read in: src/db/client.ts:3 process.env.DATABASE_URL src/db/migrate.ts:7 process.env.DATABASE_URLWhen to use
Section titled “When to use”- Audit all environment variables used in a project
- Find every place a secret is accessed before rotating it
- Verify a new variable is defined everywhere it needs to be
- Onboarding — understand external configuration dependencies
Security note
Section titled “Security note”code_env reads definitions from .env.example and config files — not from your actual .env (which is gitignored). It maps the structure of configuration, not the secret values.