Run a Command on Startup
Inspectr can start a local command when it boots, run it in the background, and capture the output in a log file. This is handy when you want your API or Webhook Backend Service and Inspectr Proxy to be started together.
Use Cases
Section titled “Use Cases”- Launch a local dev server alongside Inspectr
- Start a backend service together with Inspectr
- Trigger setup scripts in one command for teammates
Example
Section titled “Example”Start Inspectr and run a local dev server:
inspectr --command=npm --command-arg=run --command-arg=devInspectr logs command output to .inspectr/.inspectr-command-process.log by default and stops the command when Inspectr exits.
By default, Inspectr will exit if the managed command fails (non-zero exit). Set --command-stop-on-failure=false or commandStopOnFailure: false to keep Inspectr running.
You can also configure this in .inspectr.yaml, like in the example below:
This triggers node demo.js when Inspectr starts.
# Commandcommand: nodecommandArgs: - demo.js# Commandcommand: nodecommandArgs: - demo.jscommandLogFile: demo-process.log