> ## 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.

# Demo

> Generate the built-in demo session to see dbgflow's browser UI without instrumenting your own code first.

`dbgflow demo` generates a built-in sample session and writes it to a JSON file. It is the fastest way to explore the browser UI and understand what a captured execution looks like before you instrument your own code.

## What it does

Running `dbgflow demo` executes a pre-built demo pipeline and serializes the resulting session to disk. The session contains function nodes, data nodes, edges, and a sequence of execution events that you can step through in the UI.

With `--serve`, the command also starts the embedded HTTP server and opens the UI at `http://127.0.0.1:<port>` after the file is written.

## Flags

**--output** `path`

Path where the demo session JSON is written. Defaults to `artifacts/demo-session.json`.

**--serve** `flag`

Start the browser UI after the session file is generated. Opens `http://127.0.0.1:<port>` automatically.

**--port** `u16`

Port for the UI server. Only relevant when `--serve` is set. Defaults to `3000`.

## Usage examples

Generate the demo session to the default output path:

```bash theme={null}
dbgflow demo
```

Generate and immediately open the browser UI:

```bash theme={null}
dbgflow demo --serve
```

Write the session to a custom path:

```bash theme={null}
dbgflow demo --output my-demo.json
```

Open the UI on a different port:

```bash theme={null}
dbgflow demo --serve --port 8080
```

> [!TIP]
>
> If you just want to look at the UI without keeping the file, you can delete `artifacts/demo-session.json` after you close the server. To serve it again later, run `dbgflow serve artifacts/demo-session.json`.

## Next steps

Once you have seen the demo, instrument your own code with `#[trace]`, `#[ui_debug]`, and `#[dbg_test]`, then use [`dbgflow test`](https://desme.mintlify.site/cli/test) to capture real sessions from your project.


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