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

# Repositories & Git

## `list_repos`

Lists repositories indexed by Sourcebot with optional filtering and pagination.

Parameters:

| Name | Required | Description |
| :- | :- | :- |
| `query` | no | Filter repositories by name (case-insensitive). |
| `page` | no | Page number for pagination (min 1, default: 1). |
| `perPage` | no | Results per page for pagination (min 1, max 100, default: 30). |
| `sort` | no | Sort repositories by 'name' or 'pushed' (most recent commit). Default: 'name'. |
| `direction` | no | Sort direction: 'asc' or 'desc' (default: 'asc'). |

## `list_branches`

You can list a repository's branches, sorted by latest commit date (newest first). Results come from Sourcebot's local snapshot, not live from the code host. You see branches created or deleted on the code host only after Sourcebot next syncs the repository.

For each branch, you get its name, head commit SHA, latest commit time, `isDefault` (whether it is the repository's default branch), and `isIndexed` (whether code search can search that branch).

Parameters:

| Name | Required | Description |
| :- | :- | :- |
| `repo` | yes | The name of the repository to list branches for. |
| `query` | no | Filter branches by name (case-insensitive). |
| `page` | no | Page number for pagination (min 1, default: 1). |
| `perPage` | no | Results per page for pagination (min 1, max 100, default: 50). |

## `list_commits`

Get a list of commits for a given repository.

Parameters:

| Name | Required | Description |
| :- | :- | :- |
| `repo` | yes | The name of the repository to list commits for. |
| `query` | no | Search query to filter commits by message content (case-insensitive). |
| `since` | no | Show commits more recent than this date. Supports ISO 8601 (e.g., '2024-01-01') or relative formats (e.g., '30 days ago'). |
| `until` | no | Show commits older than this date. Supports ISO 8601 (e.g., '2024-12-31') or relative formats (e.g., 'yesterday'). |
| `author` | no | Filter commits by author name or email (case-insensitive). |
| `ref` | no | Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch. |
| `page` | no | Page number for pagination (min 1, default: 1). |
| `perPage` | no | Results per page for pagination (min 1, max 100, default: 50). |

## `get_diff`

Returns a structured diff between two refs in a repository using a two-dot comparison.

Parameters:

| Name | Required | Description |
| :- | :- | :- |
| `repo` | yes | The fully-qualified repository name. |
| `base` | yes | The base git ref (branch, tag, or commit SHA) to diff from. |
| `head` | yes | The head git ref (branch, tag, or commit SHA) to diff to. |


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