Skip to content

YAML Configuration

Inspectr supports configuration via a YAML file, allowing you to store and share common setups without repeating CLI flags.

By default, Inspectr automatically loads a .inspectr.yaml file file from the current working directory. This means you can simply run inspectrand Inspectr will start using the configuration defined in that file.


  • If --config is not provided and .inspectr.yaml exists in the working directory, it is loaded automatically.
  • You can specify a different file with --config.
  • CLI flags override YAML values only when the flag differs from its default; otherwise YAML wins.

listen: ':8080'
backend: 'http://localhost:3000'
print: true
app: true
appPort: '4004'
expose: true
channel: 'hello-world'
channelCode: '87654321'
authEnabled: true
authSecret: 'letsgo'
apiSecret: 'changeme'

Key Type Description
listen string Address/port to listen on (default to ":8080")
backend string URL of service to forward requests to (e.g. http://localhost:3000", https://api.stripe.com)
mockBackend string Serve mock responses from OpenAPI spec (e.g. ./openapi.yaml, https://inspectr.dev/demo/hello.openapi.yaml)
mirror boolean Echo the incoming request back immediately
catch boolean Accept and log requests without forwarding
Key Type Description
mockBackend string Path or URL to OpenAPI spec for mocking (e.g. ./openapi.yaml, https://inspectr.dev/demo/hello.openapi.yaml)
mockDynamic boolean Enable dynamic mock generation
Key Type Description
expose boolean Enable public exposure/tunnel via Inspectr Ingress
channel string Preferred subdomain on in-spectr.dev
channelCode string Security code for accessing your public endpoint
Key Type Description
app boolean Enable Inspectr App UI
appPort string Port to serve the App UI
print boolean Print color-coded log output
Key Type Description
authEnabled boolean Enable API key authentication on all requests
authSecret string Guard secret used to generate API keys
authTokenTTL integer Guard token expiration time in hours (default 24)
Key Type Description
apiSecret string Secret for securing Inspectr’s internal API
dataDir string Base directory for Inspectr data (default .inspectr)
storePath string Path to the operations store (default .inspectr/.inspectr.db)
storeInMemory boolean Store operations in memory only
backendCors boolean Allow backend to handle CORS requests
Key Type Default Description
operationsRetentionTTL string 0 Maximum age for stored operations. Use d (days), h (hours), optionally m (minutes) or s (seconds), for example 7d, 24h, 168h, 30m. 0 disables TTL cleanup.
operationsMaxStored integer 0 Maximum number of stored operations. 0 disables the cap.
operationsRetentionTTL: 24h
operationsMaxStored: 5000
Flag Type Default Description
rulesConfigPath string (none) Path to a rules YAML file to load at startup
command string (none) Launch a command when Inspectr boots
commandArgs string Arguments to pass to the managed command; repeatable
commandLogFile string .inspectr-command-process.log Log file for the managed command. Defaults to .inspectr/.inspectr-command-process.log
commandStopOnFailure boolean true Exit Inspectr when the managed command exits with a non-zero status

Key Type Default Description
export boolean false Export operations to a timestamped JSON file on shutdown
exportDir string exports Directory to write export artifacts

Key Type Description
logFile string Write logs to this file instead of .inspectr/inspectr.log
logLevel string Log verbosity: debug, info, warn, error, etc.
httpTimeout integer Timeout in seconds when forwarding requests
sessionExpiration integer Session expiration time in hours (default 24)
gracePeriod integer Grace period for session cleanup in seconds (default 30)

  • Commit .inspectr.yaml to version control for team use
  • Avoid storing sensitive tokens (use env vars or secrets management)
  • Use different configs per environment (e.g. .inspectr.dev.yaml, .inspectr.prod.yaml)