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

# Installation

> Add dbgflow to your project and install the CLI.

## Requirements

dbgflow requires **Rust 1.85** or later (edition 2024). Check your version with:

```bash theme={null}
rustc --version
```

Run `rustup update stable` to upgrade if needed.

***

## Add the library crate

Run `cargo add` from inside your project directory:

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

Or add it manually to your `Cargo.toml`:

```toml theme={null}
[dependencies]
dbgflow = "0.2"
```

***

## Install the CLI

The `dbgflow` binary provides the `demo`, `serve`, and `test` subcommands. Install it from crates.io:

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

Verify the install:

```bash theme={null}
dbgflow --help
```

***

## Import the prelude

In any file where you want to use dbgflow macros or capture helpers, import the prelude:

```rust theme={null}
use dbgflow::prelude::*;
```

This brings the following into scope:

| Item | What it provides |
| - | - |
| `#[trace]` | Marks a function as a graph node |
| `#[ui_debug]` | Marks a type for value inspection and enables `emit_snapshot` |
| `#[dbg_test]` | Wraps a test to capture its execution as a session |
| `UiDebugValue` | Trait implemented by `#[ui_debug]` types |
| `capture` | Captures a closure into a fresh in-memory session |
| `capture_to_file` | Captures a closure and writes the session to a JSON file |
| `capture_and_serve` | Captures a closure and immediately opens the browser UI |

***

## The three crates

dbgflow is published as three separate crates. In most cases you only need `dbgflow`.

| Crate | Description | When to use directly |
| - | - | - |
| [`dbgflow`](https://crates.io/crates/dbgflow) | Library facade and CLI binary. Re-exports everything from the other two crates. | Default choice for application and library authors. |
| [`dbgflow-core`](https://crates.io/crates/dbgflow-core) | Runtime, session model, and embedded UI server. | Only if you need to embed the session runtime without pulling in the CLI or macro dependencies. |
| [`dbgflow-macros`](https://crates.io/crates/dbgflow-macros) | Procedural macros: `#[trace]`, `#[ui_debug]`, `#[dbg_test]`. | Only if you are building tooling that needs the macros but not the runtime. |

> [!NOTE]
>
> When you add `dbgflow` to your `Cargo.toml`, both `dbgflow-core` and `dbgflow-macros` are pulled in automatically as transitive dependencies. You do not need to list them separately.


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