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

# CLI Overview

> Install the dbgflow CLI and learn the three subcommands available for generating demos, serving sessions, and capturing test runs.

The `dbgflow` CLI is the primary way to interact with dbgflow from the terminal. It gives you three subcommands for generating demo sessions, serving saved sessions in the browser UI, and running your test suite with automatic session capture.

## Installation

Install the CLI with Cargo:

```bash theme={null}
cargo install dbgflow
```

> [!NOTE]
>
> You also need to add dbgflow as a library dependency to the project you want to instrument:
>
> ```bash theme={null}
> cargo add dbgflow
> ```

## Subcommands

| Command | Description |
| - | - |
| `dbgflow demo` | Generate the built-in demo session and optionally open the browser UI |
| `dbgflow serve <path>` | Serve a saved session JSON file or a directory of session files |
| `dbgflow test` | Run `cargo test` with session capture and optionally open the browser UI |

## Quick Reference

```bash theme={null}
# Run the built-in demo and open the browser UI
dbgflow demo --serve

# Serve a previously captured session
dbgflow serve artifacts/session.json

# Serve all sessions in a directory as a merged view
dbgflow serve artifacts/test-sessions/run-1234567890/

# Run tests and capture sessions
dbgflow test

# Run tests for a specific project and open the UI when done
dbgflow test --manifest-path /path/to/Cargo.toml --serve

# Pass extra arguments through to cargo test
dbgflow test -- --lib
dbgflow test -- --test integration_tests
```

## Global Flags

All subcommands that start a UI server share the `--port` flag:

**--port** `u16`

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


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