# compose_diff_lines

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/widgets/diff/compose_diff_lines)

Yield per-line Static widgets for a unified diff.

Each added/removed line gets a CSS class (`.diff-line-added`,
`.diff-line-removed`) so background colors are driven by CSS variables
and update automatically on theme change.

## Signature

```python
compose_diff_lines(
    diff: str,
    max_lines: int | None = 100,
) -> ComposeResult
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `diff` | `str` | Yes | Unified diff string. |
| `max_lines` | `int \| None` | No | Maximum number of diff lines to show (None for unlimited). (default: `100`) |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/b710a69b12e49479045eaa54dfb709326473500b/libs/cli/deepagents_cli/widgets/diff.py#L19)