Skip to content

pitchfork run

  • Usage: pitchfork run [FLAGS] <ID> [-- RUN]…
  • Aliases: r

Runs a one-off daemon

Runs a command as a managed daemon without needing a pitchfork.toml. The daemon is tracked by pitchfork and can be monitored with pitchfork status.

Examples:

pitchfork run api -- npm run dev
                              Run npm as daemon named 'api'
pitchfork run api -f -- npm run dev
                              Force restart if 'api' is running
pitchfork run api --retry 3 -- ./server
                              Restart up to 3 times on failure
pitchfork run api -d 5 -- ./server
                              Wait 5 seconds for ready check
pitchfork run api -o 'Listening' -- ./server
                              Wait for output pattern before ready
pitchfork run api --http http://localhost:8080/health -- ./server
                              Wait for HTTP endpoint to return 2xx
pitchfork run api --port 8080 -- ./server
                              Wait for TCP port to be listening

Arguments

  • <ID> — Name of the daemon to run
  • [-- RUN]… — Command and arguments to run (after --)

Flags

  • -f --force — Stop the daemon if it is already running

  • --retry <RETRY> — Number of times to retry on error exit

    Default: 0

  • -d --delay <DELAY> — Delay in seconds before considering daemon ready (default: 3 seconds)

  • -o --output <OUTPUT> — Wait until output matches this regex pattern before considering daemon ready

  • --http <HTTP> — Wait until HTTP endpoint returns 2xx status before considering daemon ready

  • --port <PORT> — Wait until TCP port is listening before considering daemon ready

  • --expected-port <EXPECTED_PORT> — Port(s) the daemon is expected to bind to (can be specified multiple times or comma-separated)

  • --bump [BUMP] — Automatically find an available port if the expected port is in use

  • --cmd <CMD> — Shell command to poll for readiness (exit code 0 = ready)

  • --health-cmd <HEALTH_CMD> — Shell command to poll for health (exit code 0 = healthy)

  • --health-http <HEALTH_HTTP> — HTTP endpoint URL to poll for health

  • --health-port <HEALTH_PORT> — TCP port to probe for health (connection success = healthy)

  • -q --quiet — Suppress startup log output

  • -h --help — Print help

MIT LicenseCopyright © 2026jdx.dev