Skip to main content

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.

Read repository content without mounting MesaFS.
import { Buffer } from 'node:buffer';

const file = await mesa.content.get({ repo: 'app', path: 'README.md' });

if (file.type === 'file') {
  console.log(Buffer.from(file.content, 'base64').toString('utf8'));
}
Read a directory listing:
const root = await mesa.content.get({ repo: 'app', path: '', depth: 1 });
if (root.type === 'dir') {
  for (const entry of root.entries) console.log(entry.type, entry.path);
}

Options

repo
string
required
Repository name.
org
string | undefined
Organization override.
path
string | undefined
Repository-relative path. Omit or pass an empty string for the repository root.
change_id
string | undefined
Change to read from. Defaults to the current change at the default bookmark tip.
depth
number | undefined
Directory traversal depth from 0 to 10.

Response variants

type: 'file'
object
Regular file. Includes name, path, sha, size, encoding: 'base64', content, mode, and optional is_conflicted.
Symbolic link. Includes base64-encoded link target content and mode 120000.
type: 'dir'
object
Directory listing. Includes entries and child_count.

Required scope

read