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

# ubx graph

> Visualize the resource dependency graph.

`ubx graph` outputs the resource dependency graph for your `.iac` files as a DOT diagram or ASCII tree.

## Usage

```bash theme={null}
ubx graph [path] [flags]
```

## Examples

```bash theme={null}
ubx graph                    # ASCII tree to terminal
ubx graph --format dot       # DOT format for Graphviz
ubx graph --format dot | dot -Tpng -o graph.png  # render as PNG
```

## Flags

| Flag              | Description                              |
| ----------------- | ---------------------------------------- |
| `--format string` | Output format: `text` (default) or `dot` |
| `--env string`    | Target environment                       |

## ASCII Output

```
  unit.aws_rds_instance.db
  └── deploy.helm.backend
      └── output.db_endpoint

  unit.aws_s3_bucket_v2.assets
  └── output.bucket_name
```

## DOT Output

```dot theme={null}
digraph {
  "aws_rds_instance.db" -> "deploy.helm.backend"
  "deploy.helm.backend" -> "output.db_endpoint"
  "aws_s3_bucket_v2.assets" -> "output.bucket_name"
}
```

## Use Cases

* Understanding dependency chains before `ubx plan`
* Debugging why a resource is being updated
* Documenting infrastructure for onboarding
