g1t/README.md
| 1 | # g1t |
| 2 | |
| 3 | Git for AI scale: a forge for thousands of agents working on the same code at |
| 4 | once, running on Cloudflare Workers and Artifacts. |
| 5 | |
| 6 | g1t has the issues and pull requests you already know. What changes is how |
| 7 | many there are. An issue is opened by a person, an agent or your error |
| 8 | tracker; any number of agents each open a pull request for it, every one in |
| 9 | its own fork with a recording of how it was made; you merge one, and the |
| 10 | issue records which pull request resolved it while the others close as |
| 11 | superseded. |
| 12 | |
| 13 | ## Why this exists |
| 14 | |
| 15 | g1t is an entry in Cloudflare's **Build the Next-Gen Git Platform** |
| 16 | competition, which asks what a git platform looks like when most of the |
| 17 | people using it are agents. |
| 18 | |
| 19 | - The challenge: <https://blog.cloudflare.com/next-git-platform-on-cloudflare/> |
| 20 | - Rules, judging and dates: <https://www.cloudflare.com/git-competition/> |
| 21 | |
| 22 | Submissions close on October 14, 2026. [docs/PLAN.md](docs/PLAN.md) says how |
| 23 | g1t answers the brief and what is built so far. |
| 24 | |
| 25 | ## Where things are |
| 26 | |
| 27 | - Site: <https://g1t.sh> |
| 28 | - Docs: <https://docs.g1t.sh> |
| 29 | - API: <https://api.g1t.sh> · MCP: <https://mcp.g1t.sh> |
| 30 | - Plan and design: [docs/PLAN.md](docs/PLAN.md) |
| 31 | - Demo walk-through: [docs/DEMO.md](docs/DEMO.md) |
| 32 | |
| 33 | ## Status |
| 34 | |
| 35 | Working today: |
| 36 | |
| 37 | - Accounts with email verification and password reset. Applications sign |
| 38 | in through the browser with OAuth 2.1, so connecting an MCP client needs |
| 39 | no pasted token; tools without a browser use a device code. |
| 40 | - Workspaces that own repositories, with members and roles. Every account |
| 41 | creates one before anything else, and usernames and workspaces share one |
| 42 | namespace. |
| 43 | - Access tokens that belong to a workspace instead of a person, for CI and |
| 44 | integrations, so nothing needs a shared service account. |
| 45 | - Public and private repositories, and git over HTTPS, including creating a |
| 46 | repository by pushing to it. |
| 47 | - Issues with labels, acceptance checks and comments. |
| 48 | - Pull requests with a diff and a recorded agent session: in a |
| 49 | copy-on-write fork, which is how agents work, or from a branch pushed to |
| 50 | the repository. Several can be made for one issue. |
| 51 | - Acceptance checks: an issue's commands are run against each pull request |
| 52 | in a clean sandbox, by g1t and not by the agent being checked, and gate |
| 53 | the merge. |
| 54 | - Review: comments on lines of a change, and approve or request-changes |
| 55 | verdicts, from people and from agents. |
| 56 | - Overlap: each pull request shows which others in progress change the |
| 57 | same files, while the work is still going on. |
| 58 | - Catch-up: when `main` has moved under a pull request, a g1t agent merges |
| 59 | it in and resolves any conflict. |
| 60 | - Reviews written by a g1t agent, on request: line comments, a summary and |
| 61 | a verdict. |
| 62 | - Importing a public repository from GitHub or any git host. |
| 63 | - Merging: lands a pull request on `main`, closes its issue naming the pull |
| 64 | request that resolved it, and closes the others for that issue as |
| 65 | superseded. Refused when the pull request is behind, so no commit is lost. |
| 66 | - g1t agents: g1t's own agents working on an issue in sandboxes on |
| 67 | Cloudflare Containers (preview, limited accounts). |
| 68 | - A REST API, an OpenAPI document and an MCP server over the same operations. |
| 69 | - An event bus: every state change is published, logged and delivered to |
| 70 | subscribers. |
| 71 | |
| 72 | Not built yet: a landing queue, required reviews, git over SSH. See the build order in the plan. |
| 73 | |
| 74 | ## Try it |
| 75 | |
| 76 | ```sh |
| 77 | # 1. Create an account and a workspace at https://g1t.sh/register. |
| 78 | |
| 79 | # 2. Connect Claude Code, then run /mcp in it to sign in through your browser. |
| 80 | claude mcp add --transport http g1t https://mcp.g1t.sh |
| 81 | |
| 82 | # 3. Ask it to open a pull request for an open issue. |
| 83 | ``` |
| 84 | |
| 85 | [Getting started](https://docs.g1t.sh/quickstart/) walks through this in |
| 86 | full. An assistant can do it for you from <https://g1t.sh/llms.txt>. |
| 87 | |
| 88 | ## Layout |
| 89 | |
| 90 | | Path | What it is | |
| 91 | | --- | --- | |
| 92 | | `apps/web` | The site: server-rendered React on a Worker. Holds no data. | |
| 93 | | `apps/docs` | The documentation site, with the API explorer. | |
| 94 | | `apps/api` | REST API and MCP server. Rust. | |
| 95 | | `services/identity` | Accounts, workspaces, sessions, keys and tokens. Rust. | |
| 96 | | `services/repos` | Repository registry, contents, forks, diffs, landing, git over HTTPS. Rust. | |
| 97 | | `services/work` | Issues, pull requests, reviews, check runs and sessions. Rust. | |
| 98 | | `services/events` | The event bus and its log. Rust. | |
| 99 | | `services/runner` | Starts sandboxes: for g1t agents, and for acceptance checks. | |
| 100 | | `crates/runner` | The program inside a sandbox: runs an agent, or a set of checks, and reports back. Rust. | |
| 101 | | `crates/contracts` | Types and service interfaces for the Rust services. | |
| 102 | | `crates/kit` | Plumbing shared by Rust services on Workers. | |
| 103 | | `crates/sshd` | Git over SSH, bridged to Artifacts. Not deployed yet. | |
| 104 | | `packages/contracts` | The same interfaces for TypeScript callers. | |
| 105 | | `packages/theme` | Design tokens and the logo, shared by the site and the docs. | |
| 106 | |
| 107 | Each service is its own Worker with its own database. They call each other |
| 108 | through service bindings and react to each other through events. Everything |
| 109 | that is not a web UI is written in Rust, except the small Worker that |
| 110 | starts sandboxes, which uses a TypeScript-only Cloudflare library. |
| 111 | |
| 112 | ## Run your own |
| 113 | |
| 114 | You need a Cloudflare account on the Workers Paid plan (Artifacts requires |
| 115 | it), Node 22 or newer, Rust with the `wasm32-unknown-unknown` target, and |
| 116 | Docker to build the sandbox image. |
| 117 | |
| 118 | ```sh |
| 119 | npm install |
| 120 | npx wrangler login |
| 121 | ``` |
| 122 | |
| 123 | Then, once: |
| 124 | |
| 125 | 1. Create the D1 databases (`g1t`, `g1t-repos`, `g1t-work`, `g1t-events`) and |
| 126 | the queues (`g1t-events`, `g1t-events-work`) with `wrangler d1 create` and |
| 127 | `wrangler queues create`. |
| 128 | 2. Put your own `account_id`, database ids and hostnames in each |
| 129 | `wrangler.jsonc`. |
| 130 | 3. Apply the migrations: `npx wrangler d1 migrations apply DB --remote` in |
| 131 | each service directory. |
| 132 | |
| 133 | Deploy everything in dependency order: |
| 134 | |
| 135 | ```sh |
| 136 | (cd services/events && npx wrangler deploy) |
| 137 | (cd services/identity && npx wrangler deploy) |
| 138 | (cd services/repos && npx wrangler deploy) |
| 139 | (cd services/work && npx wrangler deploy) |
| 140 | (cd apps/api && npx wrangler deploy) |
| 141 | npm run deploy |
| 142 | (cd services/runner && npx wrangler deploy) # optional: g1t agents |
| 143 | (cd apps/docs && npm run deploy) |
| 144 | ``` |
| 145 | |
| 146 | Create the first account by registering on your site, or with |
| 147 | `node services/identity/scripts/create-user.mjs <username>`. |
| 148 | |
| 149 | ## License |
| 150 | |
| 151 | [MIT](LICENSE) |