Skip to content
Documentation

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#

  1. Install the CLI (Node 18 or newer) and sign this computer in. arcane login prints a code and a link, and a person confirms it in the browser, once.

    Terminal
    npm install -g @arcana-labs/cli --registry https://npm.arcanesuite.com/
    arcane login
  2. Create a repository and push to it. git needs no password after arcane login.

    Terminal
    arcane repo create api
    git remote add origin https://git.arcanesuite.com/acme/api.git
    git push -u origin main
  3. Push a branch, open a pull request and merge it.

    Terminal
    git 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.

TokenMade byWorks onUse it for
Computer's tokenarcane logingit and the HTTP APIA developer's machine, or an agent working on it. It acts as the person who signed in.
Personal access tokengit.arcanesuite.com/settings/tokensgit onlyCI and servers. Read, or read and write, with an optional expiry date.
Deploy tokenThe repository's Settings → Deploy tokensgit only, that one repositoryA 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.

Signed in with arcane login
git clone https://git.arcanesuite.com/acme/api.git
With a token (CI)
git 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.

CommandDoes
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 whoamiWho this computer is signed in as. Exits 1 when it isn't.
arcane logoutRevokes this computer's token and undoes the git setup.
arcane repo listYour 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.

With the CLI
arcane api git GET /api/repos/acme/api/pulls
With curl
TOKEN=$(node -p "require(require('os').homedir() + '/.config/arcane/git.json').token")
curl -H "Authorization: Bearer $TOKEN" https://git.arcanesuite.com/api/repos/acme/api/pulls

Send 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 Code
claude mcp add --transport http arcane https://mcp.arcanesuite.com/mcp
Cursor and other clients
{
  "mcpServers": {
    "arcane": { "url": "https://mcp.arcanesuite.com/mcp" }
  }
}
ToolScopeDoes
list_repositoriesgit.readThe repositories the person can open.
list_issuesgit.readA repository's issues or pull requests.
get_issuegit.readOne issue or pull request with its conversation.
comment_on_issuegit.writeA comment on an issue or a pull request.
open_pull_requestgit.pullsA pull request from a branch already pushed, for a person to review. oversightIssueId links the Oversight error it fixes.
request_code_changegit.agentsAsks 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_changegit.agentsA coding agent job: its status, summary and pull request.
cancel_code_changegit.agentsStops 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#

GET/api/repos

Your owner's repositories: { owner, repos }. ?owner=<slug> lists another owner's public ones.

POST/api/repos

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)

GET/api/repos/:owner/:repo

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.

GET/api/repos/:owner/:repo/refs

{ head, branches: [{ name, sha }], tags: [{ name, sha }] }. head is the default branch.

GET/api/repos/:owner/:repo/tree?ref=&path=

A directory: { entries: [{ name, path, type, sha }] }, directories first. type is tree, blob or commit (a submodule).

GET/api/repos/:owner/:repo/blob?ref=&path=

A file: { sha, size, binary, text }. text comes for text files up to 1 MB.

GET/api/repos/:owner/:repo/raw?ref=&path=

The file's bytes.

GET/api/repos/:owner/:repo/log?ref=&limit=&offset=

Commits, newest first: { commits: [{ sha, message, author, parents }] }. limit up to 100, 30 by default.

GET/api/repos/:owner/:repo/commit/:sha

A commit and its diff against its first parent: { commit, files }.

GET/api/repos/:owner/:repo/compare?base=&head=

What head brings since it left base: { mergeBase, totalCommits, commits, files }.

POST/api/repos/:owner/:repo/branches/delete

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.

GET/api/repos/:owner/:repo/pulls?state=open

{ pulls, open, closed }. state=closed lists closed and merged ones.

POST/api/repos/:owner/:repo/pulls

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>)

GET/api/repos/:owner/:repo/pulls/:number

The pull request with its timeline: status (open, closed or merged), base, head, their commits, and events (comments, reviews, pushes).

PATCH/api/repos/:owner/:repo/pulls/:number

Edits it, closes it or reopens it.

Body title?: string; body?: string; state?: "open" or "closed"

GET/api/repos/:owner/:repo/pulls/:number/files

The commits and files changed, as in compare.

POST/api/repos/:owner/:repo/pulls/:number/events

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

GET/api/repos/:owner/:repo/pulls/:number/mergeable

{ mergeable, conflicts, upToDate }. conflicts names the files.

GET/api/repos/:owner/:repo/pulls/:number/requirements

What the base branch's rules still need: { protected, items: [{ ok, … }], methods }. methods are the merge methods this repository allows.

POST/api/repos/:owner/:repo/pulls/:number/merge

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".

GET/api/repos/:owner/:repo/issues?state=open&q=&page=

{ issues, open, closed, pageSize }, 25 a page. Also label, assignee (me, none or an id), author, milestone and sort (newest, oldest, comments, updated).

POST/api/repos/:owner/:repo/issues

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)

GET/api/repos/:owner/:repo/issues/:number

The issue with its timeline.

PATCH/api/repos/:owner/:repo/issues/:number

Edits it, closes it or reopens it.

Body title?: string; body?: string; state?: "open" or "closed"; stateReason?: "completed" or "not_planned"

POST/api/repos/:owner/:repo/issues/:number/comments

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.

GET/api/repos/:owner/:repo/actions/runs?workflow=&page=

Runs, newest first: { runs, total, pageSize, workflows }. Each has number, workflowName, event, refName, sha, status and conclusion.

GET/api/repos/:owner/:repo/actions/runs/:number

A run with its jobs, and each job's id, name, status, conclusion and steps.

GET/api/repos/:owner/:repo/actions/jobs/:jobId/logs

A job's log as plain text, secrets masked. ?step=<n> for one step.

POST/api/repos/:owner/:repo/actions/dispatch

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

POST/api/repos/:owner/:repo/actions/runs/:number/rerun

Runs a finished run again.

Body failedOnly?: boolean (only the failed jobs and what needs them)

POST/api/repos/:owner/:repo/actions/runs/:number/cancel

Cancels a run.

POST/api/repos/:owner/:repo/actions/config/secrets

Sets a secret (admins). The same name again replaces it, and the value is never sent back.

Body name: string; value: string

POST/api/repos/:owner/:repo/actions/config/variables

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.

.arcane/agent.yml
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.

POST/api/repos/:owner/:repo/agents

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

GET/api/repos/:owner/:repo/agents

{ 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.

GET/api/repos/:owner/:repo/agents/:number

A job: status, summary, prNumber and prUrl once it opened one, testsPassed, branch, times.

POST/api/repos/:owner/:repo/agents/:number/cancel

Stops a queued or running job. Nothing is pushed.

GET/api/repos/:owner/:repo/agents/:number/log

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.

JSON
{ "error": "This pull request doesn't meet the base branch's rules yet.", "code": "requirements" }
StatusMeans
400The request is wrong: a missing field, a branch that doesn't exist, a merge method the repository doesn't allow.
401Not signed in, or this computer's token was revoked. Run arcane login.
403Signed in, but not allowed: no write access, admins only, or Arcane Git is off for the account (service_off).
404It doesn't exist, or you can't see it. A private repository you have no access to answers the same as a missing one.
409It conflicts with what's there: a name already taken, a pull request already open, merge conflicts, unmet requirements.

A change, from branch to merge#

  1. Commit on a branch and push it

    Terminal
    git switch -c add-health-check
    git add -A && git commit -m "Add a health check"
    git push -u origin add-health-check
  2. Open the pull request and keep its number

    Terminal
    arcane api git POST /api/repos/acme/api/pulls --data '{"title":"Add a health check","body":"Closes #12","base":"main","head":"add-health-check"}'
  3. See what the rules still need, and whether it merges cleanly

    Terminal
    arcane api git GET /api/repos/acme/api/pulls/14/requirements
    arcane api git GET /api/repos/acme/api/pulls/14/mergeable
  4. Merge it and delete the branch

    Terminal
    arcane api git POST /api/repos/acme/api/pulls/14/merge --data '{"method":"squash","deleteBranch":true}'

Follow a run and read why it failed#

  1. Find the run the push started

    Terminal
    arcane run list --repo acme/api
  2. Ask again every few seconds until status is completed, then read conclusion

    Terminal
    arcane run view 31 --repo acme/api
  3. Read the log of the job that failed, by the job's id from the run

    Terminal
    arcane api git GET /api/repos/acme/api/actions/jobs/<job id>/logs
  4. After the fix is pushed a new run starts by itself. To run the same commit again

    Terminal
    arcane api git POST /api/repos/acme/api/actions/runs/31/rerun --data '{"failedOnly":true}'

A secret and a workflow run by hand#

  1. Save the secret from a file or stdin, so its value stays out of the shell's history

    Terminal
    arcane secret set DEPLOY_KEY --repo acme/api --file ./deploy.key
  2. Run the workflow on a branch, with its inputs

    Terminal
    arcane 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#

  1. Open the issue

    Terminal
    arcane api git POST /api/repos/acme/api/issues --data '{"title":"Login redirects to a 404","body":"Steps to reproduce: …"}'
  2. Comment on it

    Terminal
    arcane api git POST /api/repos/acme/api/issues/15/comments --data '{"body":"Fixed by #16."}'
  3. Close it

    Terminal
    arcane 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, run arcane 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 list or from git 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 requirements and mergeable. A 409 with requirements means 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 status is completed, then read conclusion. 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 set from a file or stdin. A push that contains a known kind of key can be refused.
  • Show an API error's error text 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.

AGENTS.md
## 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#

WhatValue
One pushUp to 64 MiB
A file's text through the APIUp to 1 MB
A diff through the API300 files with their lines, 1 MB a file
Sign-in code from arcane loginValid for 10 minutes
Actions runnerUbuntu 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.

Create your Arcane Suite account

Who is this account for?