Braid is distributed as a prebuilt macOS arm64 binary through a Homebrew tap.
One braid setup command bootstraps your own GitHub App, persists credentials
outside the repository, and writes a starter configuration.
brew install xiaoland/braid/braid
braid --version- macOS arm64 (Apple Silicon).
ghinstalled and authenticated with an account that can create GitHub Apps for the target owner (user or organization).- A repository where you will install the App.
- For the Pi provider: a DeepSeek API key exported as
DEEPSEEK_API_KEY(or the environment variable configured with--api-key-environment) only at setup time.
export DEEPSEEK_API_KEY=...
braid setup owner/repository --instance <KEY>--instance defaults to the repository owner. It is the local name for the
Braid instance and appears in BRAID_INSTANCE, the ~/.braid/registry.toml,
and the service.instance.id telemetry attribute.
Options:
--provider pi|codex— defaults topi.--model <MODEL>— defaults todeepseek-chat.--api-key-environment <ENV>— env var to read the provider API key from during setup; defaults toDEEPSEEK_API_KEY. The key is then persisted into the user-level secrets file, so the env var is only needed at setup time.--user-home <DIR>— defaults to~/.braid(orBRAID_USER_HOME).--instance <KEY>— defaults to the repository owner.
braid setup performs these steps:
- Verifies
gh authand reads the acting GitHub login. - Resolves the Braid user home (
~/.braidby default) and instance key (owner by default). - Generates a random webhook secret.
- Reads the provider API key from the environment variable named by
--api-key-environment. - Builds a GitHub App Manifest with the permissions Braid needs
(
contents:write,issues:write,pull_requests:write,metadata:read). - Starts a temporary local HTTP callback server.
- Opens a browser to
github.com/settings/apps/new(or the organization variant) with the manifest pre-filled. - Captures the browser redirect and exchanges the code for the App's private key, slug, and ID.
- Writes files under
~/.braid:registry.toml— the instance registry (SSoT forBRAID_INSTANCEresolution).instances/<key>/config.toml(schema version 2)instances/<key>/github-app.pem(mode0600)instances/<key>/secrets.toml(mode0600) — webhook secret onlysecrets/<provider>.toml(mode0600) — provider API key, shared across instances for the same providerinstances/<key>/state/directory for the SQLite database, backups, and worktrees.
Using per-instance secrets and a shared user-level provider key means multiple
Braid instances can run on the same machine without colliding on a single
environment variable. BRAID_WEBHOOK_SECRET is no longer required.
After setup:
-
Install the App on your repository by visiting the printed install URL.
-
Run diagnostics:
braid doctor --instance <KEY>
-
Start Braid with a public tunnel:
braid serve --instance <KEY> --tunnel
See
tunnel.mdfor how the tunnel works and why no Cloudflare account is required.
The tunnel receives GitHub webhooks and routes them to Braid's local ingress.
Braid activates through a trusted @braid mention: a visible @braid in
an issue comment from a repository MAINTAIN/ADMIN actor wakes the Issue Agent
(after the Quiet Window). Braid acknowledges the mention with an eyes
reaction.
Native Issue assignment is a GitHub-side Agent App provisioning (the same capability that makes Copilot assignable), not a permission an ordinary GitHub App can hold — an App created through the manifest flow does not appear in the assignee picker, and assigning it via the API is rejected. If GitHub ever provisions your App as an Agent App, assignment works without any configuration change; Braid detects the mode at runtime.
braid setup also prepares the instance-scoped provider home
(~/.braid/instances/<KEY>/provider/codex) and the instance source checkout
(~/.braid/instances/<KEY>/source): one Git clone of the configured
repository shared by all Profiles. Braid never edits it directly — Agent
sessions run in dedicated generation-scoped worktrees provisioned from it
(state/worktrees/...), and each worktree's .braid/ directory is git-excluded
scratch space the Agent may use freely. Setup clones
the repository automatically; if the clone cannot run, it prints the manual
git clone command and braid doctor reports the missing checkout.
Codex authenticates per CODEX_HOME, and Braid isolates it per instance, so
your global ~/.codex credentials do not automatically apply. Setup imports
~/.codex/auth.json into the instance provider home when it exists; otherwise
authenticate it before serving:
CODEX_HOME=~/.braid/instances/<KEY>/provider/codex codex loginbraid doctor reports this as the "Codex credentials" check. The Pi provider
needs no home bootstrap: it authenticates with the API key persisted at setup.
If you cannot or do not want to open a browser from the terminal, run:
braid setup owner/repository --no-browserThis prints:
- A generated auto-submitting HTML form file; open it in any browser to POST the manifest to GitHub.
- A
curlcommand that performs the same POST. - The full manifest JSON for copy-paste creation.
- The install URL for the repository.
- Instructions on how to persist the PEM, secrets file, and config so Braid can run.
GitHub expects the manifest as a POST form field named manifest; a plain
query parameter will not pre-fill the form. The generated HTML file handles this
automatically.
- The GitHub App Manifest flow is the supported path for creating Apps programmatically; GitHub does not expose a headless API for App creation.
- The generated App logo is saved as
~/.braid/instances/<key>/braid-of-<owner>-logo.png. - Secrets are split: the webhook secret lives in the instance
secrets.toml; the provider API key lives in~/.braid/secrets/<provider>.toml. Both are mode0600.