Skip to content

serve

This command is intended for developers of Runbooks.

Use runbooks serve to start the backend API server without starting the frontend server or opening the browser.

Terminal window
runbooks serve <path-to-runbook> [flags]
  • <path-to-runbook> - Path to a directory containing the runbook.mdx file, or to the file itself.
  • --output-path <path> - Directory where generated files will be written (default: generated)
    • Can be relative (e.g., ./output) or absolute (e.g., /tmp/generated)
    • Relative paths are resolved from the current working directory
  • --no-telemetry - Disable anonymous telemetry. Can also be set via RUNBOOKS_TELEMETRY_DISABLE=1 environment variable.

When you run runbooks serve:

  1. Starts the Backend Server - Launches a Go-based HTTP server on port 7825
  2. Serves the API - Provides REST endpoints for the frontend to call
  3. Does NOT Open Browser - You must manually navigate to http://localhost:7825 or run the frontend separately

Here’s a typical development workflow:

  1. Start the backend:

    Terminal window
    runbooks serve testdata/demo-runbook

    Or if you want to easily re-compile the backend:

    Terminal window
    go run main.go serve testdata/demo-runbook
  2. In another terminal, start the frontend:

    Terminal window
    cd web
    bun dev
  3. Open your browser to http://localhost:5173 (Vite’s port)

  4. Make changes to:

    • React code in /web/src - hot reloads automatically
    • Go code - restart the serve command
    • Runbook files - refresh the browser