Developers and AI agents
Arcane Git hosts git repositories with pull requests, issues and GitHub Actions workflows. This guide is for whoever drives it without the browser: a developer in a terminal, a CI job, or an AI agent working in someone's repository. Everything is on this page, and the same text is at /git/llms.txt for agents to read.
Quick start#
Install the CLI (Node 18 or newer) and sign this computer in.
arcane loginprints a code and a link, and a person confirms it in the browser, once.Terminalnpm install -g @arcana-labs/cli --registry https://npm.arcanesuite.com/ arcane loginCreate a repository and push to it. git needs no password after
arcane login.Terminalarcane repo create api git remote add origin https://git.arcanesuite.com/acme/api.git git push -u origin mainPush a branch, open a pull request and merge it.
Terminalgit switch -c fix-login git commit -am "Fix the login redirect" git push -u origin fix-login arcane api git POST /api/repos/acme/api/pulls --data '{"title":"Fix the login redirect","base":"main","head":"fix-login"}' arcane api git POST /api/repos/acme/api/pulls/1/merge --data '{"method":"squash"}'
acme is the owner: your organization's address on Arcane Git, or your own for a personal account. arcane repo list shows it before every repository's name.
Authentication#
There are three kinds of token. They differ in what they reach.
| Token | Made by | Works on | Use it for |
|---|---|---|---|
| Computer's token | arcane login | git and the HTTP API | A developer's machine, or an agent working on it. It acts as the person who signed in. |
| Personal access token | git.arcanesuite.com/settings/tokens | git only | CI and servers. Read, or read and write, with an optional expiry date. |
| Deploy token | The repository's Settings → Deploy tokens | git only, that one repository | A server that pulls or pushes one repository. It doesn't depend on the person who made it. |
git sends a token as the password of HTTP Basic, with any username. The API takes the computer's token as Authorization: Bearer arcgit_…, and arcane api adds it for you. The token is kept in ~/.config/arcane/git.json, readable only by its owner.
A person signs out a computer in Account → Security → Your devices, which revokes its token. arcane logout does the same from the terminal.
The API doesn't accept personal access tokens or deploy tokens. A script that needs pull requests or runs uses a computer signed in with arcane login.
git over HTTPS#
Every repository clones from https://git.arcanesuite.com/<owner>/<repo>.git. There is no SSH: HTTPS is the only transport.
git clone https://git.arcanesuite.com/acme/api.gitgit clone https://ci:$ARCANE_GIT_TOKEN@git.arcanesuite.com/acme/api.git- A public repository clones without a token. A push always needs a token with write access.
- A repository's wiki is its own git repository:
https://git.arcanesuite.com/<owner>/<repo>.wiki.git. - One push takes up to 64 MiB. Push a larger history in pieces, oldest commits first.
- A push that a branch or tag rule refuses changes nothing, and git prints the reason as
remote: error: …. Read it: retrying or forcing won't pass. - A read-only token that pushes, or a push to an archived repository, gets a 403 with the reason. A wrong or revoked token gets a 401.
- Each clone, fetch and push is a git operation on the owner's invoice. Use the API to check for changes instead of fetching in a loop.
The arcane CLI#
arcane signs the computer in, sets git up, and has commands for the things git doesn't do. These are Arcane Git's; the Arcane CLI's guide has all of them, with several accounts on one computer, Arcane Compute, Arcane Oversight and Arcane Design.
| Command | Does |
|---|---|
arcane login [--no-browser] | Signs this computer in and makes it git's credential helper for Arcane Git. With --no-browser it only prints the link, for a machine without one. |
arcane whoami | Who this computer is signed in as. Exits 1 when it isn't. |
arcane logout | Revokes this computer's token and undoes the git setup. |
arcane repo list | Your repositories, as owner/name, with visibility and default branch. |
arcane repo create <name> [--internal] [--branch main] [--description …] [--import <https url>] | A new repository: private unless --internal. --import copies a public repository with its history. |
arcane secret set <NAME> --repo <owner/name> [--value … | --file … ] | An Actions secret. Without --value or --file it reads the value from stdin. |
arcane variable set <NAME> --repo <owner/name> --value … | An Actions variable. |
arcane run list --repo <owner/name> | The latest 20 Actions runs: number, workflow, event, branch and status. |
arcane run view <number> --repo <owner/name> | One run with its jobs and steps, as JSON. |
arcane api git <METHOD> <path> [--data <json> | --data @file] | Any route of the HTTP API. Prints the answer, and exits 1 with the error's message when it fails. |
HTTP API#
JSON over HTTPS at https://git.arcanesuite.com. These are the routes the app itself uses, so what a person can do in the browser, their token can do here, under the same permissions.
arcane api git GET /api/repos/acme/api/pullsTOKEN=$(node -p "require(require('os').homedir() + '/.config/arcane/git.json').token")
curl -H "Authorization: Bearer $TOKEN" https://git.arcanesuite.com/api/repos/acme/api/pullsSend bodies as JSON with Content-Type: application/json. The routes are listed in the API reference below.
MCP server#
Arcane Suite has one MCP server for all its apps, at https://mcp.arcanesuite.com/mcp. The assistant signs in with OAuth in the browser: there is no key to copy. The person picks what it may reach on the consent screen, and can disconnect it in Arcane Store → AI assistants.
claude mcp add --transport http arcane https://mcp.arcanesuite.com/mcp{
"mcpServers": {
"arcane": { "url": "https://mcp.arcanesuite.com/mcp" }
}
}| Tool | Scope | Does |
|---|---|---|
list_repositories | git.read | The repositories the person can open. |
list_issues | git.read | A repository's issues or pull requests. |
get_issue | git.read | One issue or pull request with its conversation. |
comment_on_issue | git.write | A comment on an issue or a pull request. |
open_pull_request | git.pulls | A pull request from a branch already pushed, for a person to review. oversightIssueId links the Oversight error it fixes. |
request_code_change | git.agents | Asks Arcane Git's coding agent for a change: it works on its own branch, runs the tests and opens a pull request. Billed to the repository's owner. |
get_code_change | git.agents | A coding agent job: its status, summary and pull request. |
cancel_code_change | git.agents | Stops a coding agent job that is still queued or running. |
The MCP tools read, comment, open pull requests and ask the coding agent for one. They never push, merge, review, approve, close or touch secrets: an agent pushes its branch with git (or the coding agent pushes its own), opens the pull request, and a person merges it.
The same from the public API: POST /api/v1/repos/:owner/:repo/pulls with { title, body?, head, base?, oversightIssueId? } and an assistant's or Store app's token with git.pulls. The person needs write access to the repository.
From a workflow, with Settings → Actions → Allow Actions to create pull requests turned on and permissions: pull-requests: write, the job's GITHUB_TOKEN opens one through GitHub's REST shape: POST $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls with { title, head, base?, body? } (also GET to list or read, and PATCH for the title and description). peter-evans/create-pull-request works; gh pr create doesn't (it uses GraphQL).
From a terminal, after git push: arcane pr create --title … --body … opens one from the current branch into the default branch (--base, --head, --repo, --oversight <issue id>).
The server speaks the 2026-07-28 revision of MCP only. A client on an older revision gets an error that says so.
Repositories#
Your owner's repositories: { owner, repos }. ?owner=<slug> lists another owner's public ones.
Creates a repository. Answers { owner, name }, with importing: true while an import runs.
Body name: string; description?: string; visibility?: "private" (default), "internal" or "public"; defaultBranch?: string ("main"); importUrl?: string (a public HTTPS git address to copy)
The repository: visibility, default branch, permission (what you may do: read, write or admin), status (ready, importing or failed) and its settings.
Code#
Read a repository without cloning it. ref is a branch, a tag or a commit, and defaults to the default branch.
{ head, branches: [{ name, sha }], tags: [{ name, sha }] }. head is the default branch.
A directory: { entries: [{ name, path, type, sha }] }, directories first. type is tree, blob or commit (a submodule).
A file: { sha, size, binary, text }. text comes for text files up to 1 MB.
The file's bytes.
Commits, newest first: { commits: [{ sha, message, author, parents }] }. limit up to 100, 30 by default.
A commit and its diff against its first parent: { commit, files }.
What head brings since it left base: { mergeBase, totalCommits, commits, files }.
Deletes a branch. Never the default branch, nor one a rule protects.
Body name: string
files is a list of { path, oldPath?, status, additions, deletions, binary, hunks }, with status added, modified, deleted or renamed. A file over 1 MB, or past the 300th, comes with tooLarge: true and no hunks.
Pull requests#
A pull request goes from one branch to another of the same repository. Push the branch with git first, then open it here.
{ pulls, open, closed }. state=closed lists closed and merged ones.
Opens one. Answers { number, url, base, head }. 409 when one is already open for these branches. A description naming an Oversight error issue (Fixes oversight:<id>, or the issue's link) moves that issue's fix: open, merged (awaiting deploy), closed (failed).
Body title: string; body?: string (Markdown); base?: string (the branch to merge into; the default branch when left out); head: string (the branch with the changes, already pushed); oversightIssueId?: string (adds Fixes oversight:<id>)
The pull request with its timeline: status (open, closed or merged), base, head, their commits, and events (comments, reviews, pushes).
Edits it, closes it or reopens it.
Body title?: string; body?: string; state?: "open" or "closed"
The commits and files changed, as in compare.
A comment or a review. path and line make it a comment on a line of the diff.
Body kind: "comment", "approve" or "changes" (request changes); body?: string; path?: string; line?: number
{ mergeable, conflicts, upToDate }. conflicts names the files.
What the base branch's rules still need: { protected, items: [{ ok, … }], methods }. methods are the merge methods this repository allows.
Merges it. Answers { sha, deleted }. 409 with code: "conflicts" and the files, or code: "requirements" when the rules aren't met.
Body method: "merge", "squash" or "rebase"; message?: string; deleteBranch?: boolean (delete the head branch after)
Anyone who can read the repository comments. Approving, requesting changes, opening and merging need write access.
Issues#
Issues and pull requests share one sequence of numbers. Asking for an issue by a pull request's number answers 404 with code: "pull".
{ issues, open, closed, pageSize }, 25 a page. Also label, assignee (me, none or an id), author, milestone and sort (newest, oldest, comments, updated).
Opens one. Answers { number }.
Body title: string; body?: string (Markdown); labels?: string[] (label ids, from GET …/labels); assignees?: string[] (people's ids, from GET …/assignable)
The issue with its timeline.
Edits it, closes it or reopens it.
Body title?: string; body?: string; state?: "open" or "closed"; stateReason?: "completed" or "not_planned"
A comment.
Body body: string (Markdown)
A commit that reaches the default branch, or a merged pull request, closes the issues it names with closes #12, fixes #12 or resolves #12.
Actions#
Workflows are GitHub Actions YAML in .github/workflows, unchanged. They run on push, pull request, schedule and by hand (workflow_dispatch). A run starts by itself after the push that triggers it.
Runs, newest first: { runs, total, pageSize, workflows }. Each has number, workflowName, event, refName, sha, status and conclusion.
A run with its jobs, and each job's id, name, status, conclusion and steps.
A job's log as plain text, secrets masked. ?step=<n> for one step.
Runs a workflow that has a workflow_dispatch trigger. Answers { number }.
Body path: string (".github/workflows/deploy.yml"); ref: string (a branch or tag); inputs?: object
Runs a finished run again.
Body failedOnly?: boolean (only the failed jobs and what needs them)
Cancels a run.
Sets a secret (admins). The same name again replaces it, and the value is never sent back.
Body name: string; value: string
Sets a variable (admins).
Body name: string; value: string
status is queued, in_progress, waiting (for an environment's approval) or completed. Once it is completed, conclusion is success, failure, cancelled or skipped.
Agent jobs#
Arcane Git's coding agent takes a task, works on a branch of its own (agent/<n>) in a sandbox, runs the repository's tests and opens a pull request for a person to review. It can't push any other branch and never merges. Jobs need write access. Settings → Agents picks who works on them: Arcane AI (the default) or an OpenRouter model in Arcane's cloud, billed to the repository's owner within its limits (US$5 and 60 minutes a job by default), or Arcane Code Remote, on your own computer with your Claude Code or Codex (US$0.01 a job; the computer must be online). Setup and test commands come from .arcane/agent.yml (setup: and test: lists) or Settings → Agents.
Jobs in Arcane's cloud (and Actions jobs, on the same image) have the common language runtimes: PHP 8.4 and 8.3 with the usual extensions and Composer, Node 24 and 20, Python 3.12, Ruby 3.4 with Bundler, Go 1.27, Java 21 with Maven and Gradle. Before the setup a job switches to the version your repository asks for: .arcane/agent.yml runtimes:, mise.toml, .tool-versions, .nvmrc, .node-version, .python-version, .ruby-version, .java-version, then composer.json's require.php (or config.platform.php), package.json's engines.node, pyproject's requires-python, the Gemfile's ruby, go.mod's go. The image's default stays when it fits; another version is installed once and kept in the repository's cache for the next job. The job page shows the runtimes used.
In Arcane's cloud a job starts the database servers its tests need before the agent works: MySQL 8.0, PostgreSQL 16 and Redis 7, on 127.0.0.1 with their usual ports, their data in memory and tuned for throwaway tests, with the databases and users your test configuration names. Which ones are read from .arcane/agent.yml services:, or found in the repository: phpunit.xml, .env.testing, .env.example (DB_CONNECTION, DATABASE_URL, REDIS_HOST…), config/database.yml, CI and compose services, Prisma and Django settings. The setup, the tests and the agent get ARCANE_MYSQL_URL, ARCANE_POSTGRES_URL, ARCANE_REDIS_URL and their parts.
Each repository has a cache for its agent jobs: the dependency folders its setup installs, the runtime versions the image lacks (Composer, npm, pnpm, Yarn, Bun, pip, Poetry, uv, Bundler, Go, Cargo, Maven, Gradle, Mix), keyed by their lockfiles, and snapshots of its databases after the setup, keyed by the lockfiles, the setup commands and the migration files. It is saved after a successful setup and before the agent starts, restored by the next job, free, 5 GB per repository, and entries unused for 7 days go. Settings → Agents lists it and clears it; cache: false turns it off.
setup:
- composer install --no-interaction
- php artisan migrate --env=testing
test:
- vendor/bin/phpunit
runtimes:
php: "8.3"
services:
mysql: { database: api_testing, user: root, password: secret }
redis: {}
cache:
keyFiles: ["database/seeders/**"]When a job reaches its time or spending limit after the agent changed something, the pull request opens anyway, titled [incomplete], saying what it had done and that the tests may not have run, and the job's incomplete is true.
Starts a job. Answers the job (id, number, url, status, branch…).
Body task: string (what to do); base?: string (the branch to start from; the default branch when left out); issueNumber?: number (work on that issue: its pull request says Fixes #n); runner?: "arcane" (Arcane AI, in Arcane's cloud), "openrouter" (in Arcane's cloud, with model: an OpenRouter model id) or "code" (Arcane Code Remote: on your computer running Arcane Code, with device, harness: "claude" or "codex", and its model and effort); the repository's settings when left out
{ jobs }, newest first. Each has status: queued, running, pr_opened (incomplete: a limit stopped it before the agent finished), no_fix (the agent found nothing to change, summary says why), failed (error says why) or canceled.
A job: status, summary, prNumber and prUrl once it opened one, testsPassed, branch, times.
Stops a queued or running job. Nothing is pushed.
Its log as plain text.
With an assistant's or Store app's token (scope git.agents) the same is at /api/v1/repos/:owner/:repo/agent-jobs[/:id[/cancel]], which also takes oversightIssueId (the Oversight error it fixes), context (an error, a stack trace or a log: given to the agent as data, never as instructions) and tighter limits: { usd, minutes }. On a pull request the agent opened, a comment that mentions @agent asks it for another round on the same branch.
Errors#
Every error has the same shape. error is a sentence written for a person: show it as it is. code comes only where a program needs to tell cases apart.
{ "error": "This pull request doesn't meet the base branch's rules yet.", "code": "requirements" }| Status | Means |
|---|---|
| 400 | The request is wrong: a missing field, a branch that doesn't exist, a merge method the repository doesn't allow. |
| 401 | Not signed in, or this computer's token was revoked. Run arcane login. |
| 403 | Signed in, but not allowed: no write access, admins only, or Arcane Git is off for the account (service_off). |
| 404 | It doesn't exist, or you can't see it. A private repository you have no access to answers the same as a missing one. |
| 409 | It conflicts with what's there: a name already taken, a pull request already open, merge conflicts, unmet requirements. |
A change, from branch to merge#
Commit on a branch and push it
Terminalgit switch -c add-health-check git add -A && git commit -m "Add a health check" git push -u origin add-health-checkOpen the pull request and keep its number
Terminalarcane api git POST /api/repos/acme/api/pulls --data '{"title":"Add a health check","body":"Closes #12","base":"main","head":"add-health-check"}'See what the rules still need, and whether it merges cleanly
Terminalarcane api git GET /api/repos/acme/api/pulls/14/requirements arcane api git GET /api/repos/acme/api/pulls/14/mergeableMerge it and delete the branch
Terminalarcane api git POST /api/repos/acme/api/pulls/14/merge --data '{"method":"squash","deleteBranch":true}'
Follow a run and read why it failed#
Find the run the push started
Terminalarcane run list --repo acme/apiAsk again every few seconds until
statusiscompleted, then readconclusionTerminalarcane run view 31 --repo acme/apiRead the log of the job that failed, by the job's
idfrom the runTerminalarcane api git GET /api/repos/acme/api/actions/jobs/<job id>/logsAfter the fix is pushed a new run starts by itself. To run the same commit again
Terminalarcane api git POST /api/repos/acme/api/actions/runs/31/rerun --data '{"failedOnly":true}'
A secret and a workflow run by hand#
Save the secret from a file or stdin, so its value stays out of the shell's history
Terminalarcane secret set DEPLOY_KEY --repo acme/api --file ./deploy.keyRun the workflow on a branch, with its inputs
Terminalarcane api git POST /api/repos/acme/api/actions/dispatch --data '{"path":".github/workflows/deploy.yml","ref":"main","inputs":{"environment":"staging"}}'
An issue, a comment, and closing it#
Open the issue
Terminalarcane api git POST /api/repos/acme/api/issues --data '{"title":"Login redirects to a 404","body":"Steps to reproduce: …"}'Comment on it
Terminalarcane api git POST /api/repos/acme/api/issues/15/comments --data '{"body":"Fixed by #16."}'Close it
Terminalarcane api git PATCH /api/repos/acme/api/issues/15 --data '{"state":"closed","stateReason":"completed"}'
Rules for agents#
- Start with
arcane whoami. If the computer isn't signed in, runarcane login --no-browser, give the person the link and the code it prints, and wait for them. Never ask for a password or a token in the conversation. - Take the owner and the repository's name from
arcane repo listor fromgit remote -v. Never guess them. - Change code with git: branch, commit, push. Use the API for pull requests, issues and runs. The MCP tools only read and comment.
- Work on a branch and open a pull request. Push to the default branch only when the person asked for it.
- When a push is refused, read the
remote: error:lines and do what they say. Don't force-push to get around a rule. - Before merging, read
requirementsandmergeable. A 409 withrequirementsmeans approvals or checks are missing: tell the person what's missing instead of trying again. - After a push, wait for the run through the API: ask until
statusiscompleted, then readconclusion. Don't fetch in a loop: every fetch is a billed git operation. - When a run fails, read the failed job's log before changing anything.
- Never write a secret into a file, a commit, a pull request or the conversation. Set it with
arcane secret setfrom a file or stdin. A push that contains a known kind of key can be refused. - Show an API error's
errortext to the person as it is. It says what went wrong.
AGENTS.md
Paste this into your project's AGENTS.md or CLAUDE.md, with your repository's name.
## Arcane Git
This repository is hosted on Arcane Git: https://git.arcanesuite.com/acme/api
Full guide for agents: https://arcanesuite.com/git/llms.txt
- Run `arcane whoami` first. If it fails, run `arcane login --no-browser`, show me the link and the code, and wait.
- Change code with git on a branch, push it, and open a pull request:
`arcane api git POST /api/repos/acme/api/pulls --data '{"title":"…","base":"main","head":"<branch>"}'`
- Don't push to main and don't force-push unless I ask.
- After a push, follow the run with `arcane run list --repo acme/api` and `arcane run view <number> --repo acme/api`
until its status is completed. If it failed, read the job's log:
`arcane api git GET /api/repos/acme/api/actions/jobs/<job id>/logs`
- Before merging, check `GET /api/repos/acme/api/pulls/<number>/requirements`. Merge only when I ask.
- Secrets go in with `arcane secret set <NAME> --repo acme/api --file <file>`. Never print or commit them.
- Don't run git fetch in a loop to wait for something: use the API.Limits and prices#
| What | Value |
|---|---|
| One push | Up to 64 MiB |
| A file's text through the API | Up to 1 MB |
| A diff through the API | 300 files with their lines, 1 MB a file |
Sign-in code from arcane login | Valid for 10 minutes |
| Actions runner | Ubuntu 24.04, 2 vCPUs, 8 GB of memory, 16 GB of disk |
| Storage | $0.80 per GB a month |
| Git operations (clone, fetch, push) | $0.25 per 1,000 |
| Actions | $0.006 per minute, each job rounded up |
API calls aren't charged.
Links#
- git.arcanesuite.com: the app.
- /git/llms.txt: this guide as plain Markdown, for agents.
- Arcane Git: what it is and what it costs.
- AI assistants: connect and disconnect MCP clients.