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

# content.get()

> Read a file, symlink, or directory listing from a repository.

Read repository content without mounting the filesystem.

**Required scope: `read`**

```python theme={null}
root = await mesa.content.get(repo="app", depth=1)
print(root.type)
print(root.is_dir())

readme = await mesa.content.get(repo="app", path="README.md")
if readme.is_file():
    print(readme.content)  # base64-encoded bytes
```

## Options

**repo** `str` *required*

Repository name.

**change\_id** `str | None`

Change ID to read from. Defaults to the current change at the repository's default bookmark tip.

**path** `str | None`

Repository-relative path. Omit for the repository root.

**depth** `int | None`

Directory traversal depth. `0` returns directory metadata only, `1` returns direct children, and the server maximum is `10`.

## Response

The method returns one generated model variant. The generated `type_` field
remains available, and `type` is exposed as a read-only alias.

**is\_file()** `bool`

Returns `True` when the response is a regular file.

**is\_dir()** `bool`

Returns `True` when the response is a directory.

**is\_symlink()** `bool`

Returns `True` when the response is a symlink.

**type: 'file'** `ContentFile`

Regular file content.

**type: 'symlink'** `ContentSymlink`

Symbolic link content.

**type: 'dir'** `ContentDirectory`

Directory listing.

### ContentFile

**type** `'file'`

Content variant discriminator.

**name** `str`

Base name of the file.

**path** `str`

Repository-relative path.

**sha** `str`

Git object SHA.

**is\_conflicted** `bool | None`

Whether this path is conflicted when known.

**size** `int`

Size in bytes.

**encoding** `'base64'`

Encoding used for `content`.

**content** `str`

Base64-encoded file bytes.

**mode** `'100644' | '100755'`

POSIX file mode.

**xattrs** `dict[str, str] | None`

Extended attributes for this path. Values are base64-encoded.

### ContentSymlink

**type** `'symlink'`

Content variant discriminator.

**name** `str`

Base name of the symlink.

**path** `str`

Repository-relative path.

**sha** `str`

Git object SHA.

**is\_conflicted** `bool | None`

Whether this path is conflicted when known.

**size** `int`

Size in bytes.

**encoding** `'base64'`

Encoding used for `content`.

**content** `str`

Base64-encoded symlink target bytes.

**mode** `'120000'`

POSIX symlink mode.

**xattrs** `dict[str, str] | None`

Extended attributes for this path. Values are base64-encoded.

### ContentDirectory

**type** `'dir'`

Content variant discriminator.

**name** `str`

Base name of the directory.

**path** `str`

Repository-relative path.

**sha** `str`

Git object SHA.

**child\_count** `int`

Number of direct children in this directory.

**entries** `list[ContentDirectoryEntry]`

Directory entries returned for the requested depth.

**xattrs** `dict[str, str] | None`

Extended attributes attached to this directory. Values are base64-encoded.

### ContentDirectoryEntry

**type** `'file' | 'symlink' | 'dir'`

Entry variant discriminator.

**name** `str`

Base name of the entry.

**path** `str`

Repository-relative path.

**sha** `str`

Git object SHA.

**size** `int | None`

Size in bytes for file and symlink entries.

**mode** `'100644' | '100755' | '120000' | None`

POSIX mode for file and symlink entries.


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