GitHub
Machines talk to GitHub through a single GitHub App per cluster. Orgs install the app on their
GitHub accounts, projects choose which repositories to expose, and machines receive short-lived
tokens scoped to one repository at a time—minted on demand by git or gh, expiring within an
hour, and never written to disk.
Manage the app and installations in Settings → GitHub (or anastroctl apps github), and
project repositories in Project settings → Repositories (or anastroctl project repo).
Register the GitHub App
Section titled “Register the GitHub App”A cluster admin sets this up once. In Settings → GitHub, click Create GitHub App to open GitHub with the permissions prefilled (read/write contents and pull requests; read checks, statuses, and metadata). Name the app, optionally pick a GitHub org to own it, confirm, and GitHub redirects back with the app registered. Or via CLI:
anastroctl apps github setup create [--github-org acme] [--administration]anastroctl apps github setup statusPrefer an existing GitHub App? Choose Use an existing app (or anastroctl apps github setup import) and supply its app ID, private key, and—for user account linking and webhooks—its client
ID, client secret, and webhook secret, configuring the callback URL shown in the dialog.
To replace the app (even if you already deleted it on GitHub), click Remove in Settings → GitHub or run:
anastroctl apps github setup remove --yesRemoving clears the app, installations, project repo links, linked user accounts, and cached tokens inside Anastro without touching GitHub itself. Afterward, register or import the new app, install it for each org, re-add project repos, and re-link user accounts.
Install the app for your org
Section titled “Install the app for your org”In Settings → GitHub, an org owner or admin clicks Install on GitHub and selects the GitHub account/org and repositories. Or from the CLI:
anastroctl apps github installation addanastroctl apps github installation listanastroctl apps github installation unlink <installation>If GitHub can’t redirect back automatically (no public hooks hostname and the app was created from
the CLI), a cluster admin links the pending installation in Settings → GitHub (Link to) or
via anastroctl apps github installation link <installation>.
Grant repositories to a project
Section titled “Grant repositories to a project”Project owners pick which repositories from the org’s installations a project can access, read-only or read-write. Open the project menu → Project settings → Repositories → Add repository (if a repo isn’t listed, add it to the installation on GitHub first), or run:
anastroctl project repo --project api availableanastroctl project repo --project api add acme/api --writeanastroctl project repo --project api add acme/docsanastroctl project repo --project apianastroctl project repo --project api remove acme/docs # immediately revokes minted tokensUse git and gh in a machine
Section titled “Use git and gh in a machine”Clone and push over HTTPS normally—Anastro’s credential helper mints tokens behind the scenes:
git clone https://github.com/acme/apigit push origin anastro/fix-auth-test- Every token is scoped to one repository, lasts at most an hour, and stays out of
/workspace(so it never lands in a snapshot, rollback, or fork). - Write access requires both a read-write repo binding on the project and an
editor(or higher) project role for the person the machine acts as; viewers get read-only tokens. - Every mint is recorded in the audit log with the machine, thread, and user. Removing the repo or the user revokes active tokens.
Provisioned machines also include a brokered gh CLI. Run gh inside a cloned
repo, set GH_REPO, or pass --repo owner/name—it receives a short-lived installation token in its
environment and never saves credentials into the workspace.
Link your GitHub account
Section titled “Link your GitHub account”Optional, but recommended so commits and PR reviews happen as you. Click Link GitHub account in Settings → Account, or run:
anastroctl apps github account linkanastroctl apps github account statusanastroctl apps github account emailanastroctl apps github account email you@example.comanastroctl apps github account email --noreplyanastroctl apps github account name "Your Name"anastroctl apps github account name --profileanastroctl apps github account unlinkWhen linked:
- Local commits use your GitHub name (or custom override) and your no-reply or chosen verified GitHub email. Verified API commits (below) are authored by GitHub directly as your account.
- Pull request actions in the UI run under your GitHub account with your permissions.
- If your operator enabled per-user repo checks, machines acting for you can only reach repositories your own GitHub account can access.
Commit identity, signed commits, and branch prefixes
Section titled “Commit identity, signed commits, and branch prefixes”Org owners and admins configure defaults under Settings → GitHub → Commit identity and branches, or via CLI:
anastroctl org gitanastroctl org git --author user --committer bot --branch-prefix anastro/anastroctl org git --trailer 'Co-authored-by: {user.name} <{user.github_email}>'| Setting | Default | Options |
|---|---|---|
--author |
user (linked GitHub identity, else the app bot) |
bot, fixed (--author-name, --author-email) |
--committer |
bot |
author |
--branch-prefix |
anastro/ |
Any prefix |
--trailer |
None | Templates; --no-trailers clears them |
Machines expose these via GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME,
GIT_COMMITTER_EMAIL, ANASTRO_GIT_BRANCH_PREFIX, and ANASTRO_GIT_TRAILERS.
- Branches: run
git anastro-branch [slug]to create a prefixed branch (defaults to the thread or machine ID). Ordinarygit commitappends the org’s trailers via a guest hook. - Signed API commits: stage files with
git add, push the branch once, then rungit anastro-commit 'Message'or click Commit in the Diff tab. By default, Anastro creates a verified commit via GitHub’s API as your linked account (or the app) and fast-forwards localHEADwhile keeping unstaged changes. GitHub’s signed API only supports regular files—use normal unsignedgit commit(which the org can also set as default) for executables, symlinks, submodules, or mode changes. - Branch-prefix enforcement: if your operator enables
[git] enforce_branch_prefix = true, the host proxy blocks pushes outside the org prefix (up to 64 MiB per push). Guests receive read-only tokens while write credentials stay in the host broker.
Pull requests and PR stacks
Section titled “Pull requests and PR stacks”Link pull requests to a thread in three ways:
- Add one in the right panel’s Linked pull requests tab by URL,
owner/name#12, or#12(when the project has one repo). - Have the agent open one with
pull_request_open(asks first in supervised mode). - Have the agent link an existing PR with
pull_request_link.
Pushing a branch alone doesn’t link a PR. Each linked PR opens in a Pull request tab:
| Section | What’s inside |
|---|---|
| Summary | Description, CI checks, and review form (Comment, Approve, Request changes) |
| Guide | Agent-written reading guide for the diff (Write guide asks the agent to create one) |
| Timeline | Commits, reviews, and comments, each with Add to chat and inline replies |
| Code | Changed files with Viewed checkboxes (when linked) and gutter Post on GitHub line comments |
The primary action adapts to the PR state (Merge, Ready for review, or Reopen; Close and other actions sit under ⋯). Every action displays which GitHub identity it will use (yours if linked, otherwise the app bot on read-write repos). Editors can act; viewers can read.
Live updates: with the Cloudflare Tunnel enabled, signed GitHub webhooks update open PR tabs immediately (without it, tabs poll every minute), and GitHub account linking redirects back over the hooks hostname from any browser. For existing GitHub Apps, subscribe to Pull request reviews, Pull request review comments, and Issue comments in your GitHub webhook settings so conversation updates arrive live.
PR stacks: link every PR in a stack (each targeting the branch below it), then click Set stack
order in Linked pull requests from bottom to top. Merge blocks a PR until its parent merges,
then automatically retargets it onto the parent’s base branch. Anastro won’t rebase or force-push
stack branches for you. Agents can manage stacks and comments with pull_request_stack and
pull_request_comment (posting a comment asks for approval in supervised mode).
- Secrets: inject 1Password project secrets into machines.
- Full design: Git access and secrets in the spec.