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.

Create a new change, optionally applying initial file operations atomically. File content must be base64-encoded.
import { Buffer } from 'node:buffer';

const change = await mesa.changes.create({
  repo: 'app',
  base_change_id: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
  message: 'Add README',
  author: { name: 'Docs Bot', email: 'docs@example.com' },
  files: [
    {
      path: 'README.md',
      content: Buffer.from('# App\n').toString('base64'),
    },
    { path: 'old.txt', action: 'delete' },
  ],
});

Options

repo
string
required
Repository name.
base_change_id
string
required
Change to create the new change on top of. Use Mesa’s virtual root change ID for the first change in an empty repository.
org
string | undefined
Organization override.
message
string | undefined
Change message. Required when files is non-empty.
author
object | undefined
Commit author identity. Required when files is non-empty.
committer
object | undefined
Committer identity. When omitted, the server falls back to author.
files
array | undefined
File operations to apply atomically. Upserts use { path, content, encoding?, action?, mode? }; deletes use { path, action: 'delete' }.

Response

Returns a change object with id, current_commit_oid, is_conflicted, message, author, committer, parents, created_at, and updated_at.

Required scope

write