# format_content_with_line_numbers

> **Function** in `deepagents`

📖 [View in docs](https://reference.langchain.com/python/deepagents/backends/utils/format_content_with_line_numbers)

Format file content with line numbers (cat -n style).

Chunks lines longer than MAX_LINE_LENGTH with continuation markers (e.g., 5.1, 5.2).

## Signature

```python
format_content_with_line_numbers(
    content: str | list[str],
    start_line: int = 1,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `content` | `str \| list[str]` | Yes | File content as string or list of lines |
| `start_line` | `int` | No | Starting line number (default: 1) (default: `1`) |

## Returns

`str`

Formatted content with line numbers and continuation markers

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/88c2b5cb874dc1d093acf54d2a967ba6e085c99b/libs/deepagents/deepagents/backends/utils.py#L107)