Inspectr supports a wide range of CLI flags to control how it captures, proxies, and exposes traffic. These options allow you to customize Inspectr to match your workflow.
Flag Type Default Description --listenstring :8080Address where Inspectr listens for HTTP requests --backendstring (none) Forward requests to this backend service --mock-backendstring (none) Serve mock responses from OpenAPI spec --mock-dynamicboolean falseGenerate dynamic mock data instead of static examples --mirrorboolean falseImmediately echo the original request back --catchboolean falseAccept and log requests without forwarding
Flag Type Default Description --appboolean trueEnable embedded Inspectr App UI & API --app-portstring 4004Port to serve the UI app --printboolean truePrint color-coded log output to the terminal
Flag Type Default Description --exposeboolean falseExpose Inspectr publicly via Ingress --channelstring (none) Subdomain to use (e.g. my-api.in-spectr.dev) --channel-codestring (none) Secret code required for remote access to the channel
Flag Type Default Description --auth-enabledboolean falseEnable API key authentication for proxied requests --auth-secretstring (none) Guard secret used to generate API keys --auth-token-ttlinteger 24Guard token expiration time in hours
Flag Type Default Description --api-secretstring (none) Protect access to Inspectr’s admin API --backend-corsboolean falseLet the backend handle CORS preflight instead of Inspectr --data-dirstring .inspectr/Base directory for Inspectr data (DBs, logs) --store-pathstring .inspectr/.inspectr.dbPath to store request/response history --store-in-memoryboolean falseUse in-memory storage instead of persistent disk file
Flag Type Default Description --configstring .inspectr.yamlPath to YAML config file. Auto-detect .inspectr.yaml if present. --versionPrint Inspectr version and exit
Flag Type Default Description --rules-configstring (none) Path to a rules YAML file to load at startup --commandstring (none) Launch a command when Inspectr boots --command-argstring Argument to pass to the managed command; repeatable --command-log-filestring .inspectr-command-process.logLog file for the managed command. Defaults to .inspectr/.inspectr-command-process.log --command-stop-on-failureboolean trueExit Inspectr when the managed command exits with a non-zero status
Flag Type Default Description --exportboolean falseExport operations to a timestamped JSON file on shutdown
Flag Type Default Description --log-filestring (none) Write logs to this file instead of .inspectr/inspectr.log --log-levelstring noneSet log verbosity (debug, info, warn, etc.) --http-timeoutinteger 30HTTP timeout in seconds for backend requests. Expose has a maxmium http-timeout of 30 seconds for non-streaming responses. --session-expirationinteger 24Session expiration time in hours --grace-periodinteger 30Grace period for session cleanup in seconds
inspectr --backend=http://localhost:3000
inspectr --catch=true --expose --channel=webhook-test --channel-code=secure123
inspectr --mock-backend=./openapi.yaml --mock-dynamic=true
By default, Inspectr looks for a .inspectr.yaml file in the current directory, so you can run
which will load the default configuration.
If you prefer to use a different config file, you can specify it with the --config flag:
inspectr --config=./inspectr-webhook.yaml
Inspectr can also be used to trigger a command when it starts. This can be any command to start a program or a shell script.
Common use cases include running a development server or running a test suite, launch a Inspectr Connector, or run a custom script.
inspectr --command=npm --command-arg=run --command-arg=dev
Inspectr will run the command in the background and log its output to .inspectr/inspectr-command-process.log.
When Inspectr exits, the command will be terminated.