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

# debug

> Collect a diagnostic bundle for the active context.

Use `debug` to capture a snapshot of the active context's state when reporting an issue or diagnosing unexpected behaviour. The bundle prints to stdout by default. Pipe it to a file or use `--output` to save it directly.

The core bundle includes an ingress section built from the same route and port
resolver used by [`sitectl stats`](/commands/stats). This shows the primary URL,
plugin-declared secondary routes, trusted proxy settings, and whether Traefik's
HTTP/HTTPS host ports are running or would be published on the next start.

## Reference

Collect a diagnostic bundle for the active context and print it to stdout.

The bundle includes: host resource summary, Compose service status, container log driver
configuration, Docker image inventory, and plugin-specific diagnostics contributed by the
context's plugin.

Use `--output` to write the bundle to a file instead of printing to stdout.

```bash theme={null}
sitectl debug
```

| Flag            | Default | Description                                   |
| --------------- | ------- | --------------------------------------------- |
| `-o, --output`  |         | Write the bundle to a file instead of stdout. |
| `-v, --verbose` | `false` | Include additional diagnostic details.        |

## Sharing a bundle

```bash theme={null}
# Save to a file
sitectl debug --output debug-bundle.txt

# Capture stdout directly
sitectl debug > debug-bundle.txt
```

Plugin diagnostics are included automatically, so the bundle captures stack-specific state without any extra flags.
