Environment Files

Load .env files with
secret redaction

Automatically load variables from .env files with environment-specific overrides. Secrets are automatically redacted in output to prevent accidental exposure.

Use .env files with automatic secret protection

env-files.yaml
# .env file
API_URL=https://api.example.com
SECRET_API_KEY=sk_live_abc123def456

# api.yaml
request:
  url: ${API_URL}/users
  headers:
    Authorization: Bearer ${SECRET_API_KEY}

# Run with environment
curl-runner api.yaml --env production

# Output shows redacted secrets
#   curl -H 'Authorization: Bearer [REDACTED]' ...
Key Benefits

Why use Environment Files?

Automatic .env Loading

Load variables from .env, .env.local, .env.{environment}, and .env.{environment}.local files automatically.

Secret Redaction

Variables prefixed with SECRET_ are automatically redacted in output. Common API key patterns are also detected.

Environment Overrides

Use --env flag to load environment-specific files like .env.staging or .env.production.

Use Cases

Perfect for these scenarios

Managing secrets across environments
Preventing credential leaks in logs
Environment-specific configuration
Team collaboration with shared .env.example

Ready to try Environment Files?

Get started with curl-runner and unlock powerful environment files capabilities for your API testing workflow.