Skip to main content
Create a repository in the current or specified organization. Required scope: write
const repo = await mesa.repos.create({ name: 'app' });

console.log(repo.name);
console.log(repo.head_change_id);
Create with an upstream Git remote:
const repo = await mesa.repos.create({
  name: 'app',
  default_bookmark: 'main',
  upstream: {
    url: 'https://github.com/acme/app.git',
    auth: { kind: 'token', token: 'github_pat_...', token_username: 'bot' },
  },
});

Options

org
string | undefined
Organization override.
name
string | undefined
Repository name. If omitted, the API generates a name.
default_bookmark
string | undefined
Default bookmark name. Defaults to main when omitted.
tags
Record<string, string> | undefined
String key-value repository metadata.
upstream
object | undefined
Optional upstream Git remote to attach at create time. On create, omitting auth and passing auth: null both create a public upstream. Pass token or username/password auth to store credentials.

Response

id
string
Repository ID.
org
string
Organization slug.
name
string
Repository name.
default_bookmark
string
Default bookmark name.
head_change_id
string
Current change ID at the default bookmark tip.
upstream
UpstreamConfig | null
Configured upstream remote, or null when no upstream is configured.
created_at
string
Creation time.
tags
Record<string, string>
Repository tags.

UpstreamConfig

url
string
Upstream Git remote URL.
auth_kind
'token' | 'username_password' | null
Stored upstream authentication kind, or null when the upstream is public.