> ## Documentation Index
> Fetch the complete documentation index at: https://desme.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Serve

> Serve a saved session JSON file or an entire directory of session files in the dbgflow browser UI.

`dbgflow serve <path>` starts the embedded HTTP server and loads a previously captured session into the browser UI. You can point it at a single JSON file or a directory — when given a directory, it merges all JSON files it finds into one session with multiple pipelines.

## What it does

The command reads the session JSON at the path you provide, starts an HTTP server, and opens the UI in your browser. The UI lets you step through execution events, inspect function inputs and outputs, view value snapshots, and navigate the call graph.

When you pass a directory, dbgflow discovers every `.json` file inside it, reads each one, and merges them into a single session. Each original file becomes a separate pipeline, selectable from the Pipeline Selector in the bottom control bar.

## Arguments

**session** `path` *required*

Path to a session JSON file, or a directory containing session JSON files. This is a positional argument — no flag name required.

## Flags

**--port** `u16`

Port for the UI server. Defaults to `3000`.

## Usage examples

Serve a single session file:

```bash theme={null}
dbgflow serve artifacts/session.json
```

Serve all sessions captured in a test run directory:

```bash theme={null}
dbgflow serve artifacts/test-sessions/run-1714000000000/
```

Use a custom port:

```bash theme={null}
dbgflow serve artifacts/session.json --port 8080
```

## Directory serving

When you pass a directory, dbgflow reads every `.json` file it contains and merges them into one session. Each file maps to a pipeline in the UI.

```bash theme={null}
# Assuming the directory contains:
#   run-1714000000000/
#     state_flow.json
#     process_data.json
#     integration_test.json

dbgflow serve artifacts/test-sessions/run-1714000000000/
```

The Pipeline Selector in the bottom bar lets you switch between `state_flow`, `process_data`, and `integration_test` without reloading.

> [!NOTE]
>
> Only files with a `.json` extension are included. Subdirectories and other file types are ignored.

> [!TIP]
>
> After running `dbgflow test`, the CLI prints the path of the most relevant session — the first failing test session, or the first session if all tests passed. You can copy that path directly into `dbgflow serve`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.