| 1 | # g1t |
| 2 | |
| 3 | > g1t (https://g1t.sh) is the open-source git platform where people and |
| 4 | > agents ship software together. It is ordinary git over HTTPS, with |
| 5 | > issues, pull requests and reviews. Agents are members of the forge: you |
| 6 | > assign an issue to g1t or connect your own over MCP, or hand g1t an |
| 7 | > outcome and a planner splits it into issues with dependencies that agents |
| 8 | > work in parallel, aware of each other. A repository's workflows are its |
| 9 | > checks, for people and agents alike; a merge queue lands each change on main only once it passes together with |
| 10 | > everything ahead of it, and deployments put a preview of every pull |
| 11 | > request and production on g1t.page. Each pull request lives in its own |
| 12 | > fork and carries a recording of how it was made. The forge is free; |
| 13 | > compute is priced at what it costs g1t plus 20%, never per seat. |
| 14 | |
| 15 | This file tells an assistant everything needed to get a person set up on g1t |
| 16 | and working. You never ask for, see, or send the person's password. Accounts |
| 17 | are created and approved only in their browser. |
| 18 | |
| 19 | ## Set someone up |
| 20 | |
| 21 | 1. **Start a sign-in.** |
| 22 | |
| 23 | ```sh |
| 24 | curl -X POST https://api.g1t.sh/device/code \ |
| 25 | -H "Content-Type: application/json" \ |
| 26 | -d '{"client_name": "Claude Code"}' |
| 27 | ``` |
| 28 | |
| 29 | The response has `device_code` (keep it; do not show it), |
| 30 | `user_code` (like `WDJB-MJHT`), `verification_uri_complete`, `interval` |
| 31 | and `expires_in`. |
| 32 | |
| 33 | 2. **Send the person to their browser.** Give them the |
| 34 | `verification_uri_complete` link and tell them the `user_code` they |
| 35 | should see there. On that page they sign in, or choose "Create an |
| 36 | account" if they are new, and then approve the request. Wait for them. |
| 37 | |
| 38 | A new account also gets a confirmation email from `noreply@g1t.sh`. Ask |
| 39 | them to open it and follow the link. Until they do, the account cannot |
| 40 | create repositories, push, or open issues: those calls return `403` |
| 41 | with a message saying to confirm the address. |
| 42 | |
| 43 | 3. **Collect the token.** Poll every `interval` seconds, not faster: |
| 44 | |
| 45 | ```sh |
| 46 | curl -X POST https://api.g1t.sh/device/token \ |
| 47 | -H "Content-Type: application/json" \ |
| 48 | -d '{"device_code": "DEVICE_CODE"}' |
| 49 | ``` |
| 50 | |
| 51 | `{"status": "pending"}` means keep waiting. `denied` and `expired` mean |
| 52 | start again from step 1. `approved` comes with `token`, `username` and |
| 53 | `verified`. The token is returned once. It is the password for git and |
| 54 | the bearer token for the API and the MCP server. Store it as `G1T_TOKEN`; |
| 55 | never write it into a repository. Your person can see and delete it at |
| 56 | g1t.sh/settings/tokens. If `verified` is `false`, the |
| 57 | confirmation email has not been followed yet. |
| 58 | |
| 59 | 4. **Connect the MCP server** (any MCP client with HTTP transport works). |
| 60 | Claude Code: |
| 61 | |
| 62 | ```sh |
| 63 | claude mcp add --transport http g1t https://mcp.g1t.sh \ |
| 64 | --header "Authorization: Bearer $G1T_TOKEN" |
| 65 | ``` |
| 66 | |
| 67 | Codex, in `~/.codex/config.toml`: |
| 68 | |
| 69 | ```toml |
| 70 | [mcp_servers.g1t] |
| 71 | url = "https://mcp.g1t.sh" |
| 72 | bearer_token_env_var = "G1T_TOKEN" |
| 73 | ``` |
| 74 | |
| 75 | OpenCode, in `opencode.json`: |
| 76 | |
| 77 | ```json |
| 78 | { "mcp": { "g1t": { "type": "remote", "url": "https://mcp.g1t.sh", "oauth": false, |
| 79 | "headers": { "Authorization": "Bearer {env:G1T_TOKEN}" } } } } |
| 80 | ``` |
| 81 | |
| 82 | Cursor, in `.cursor/mcp.json`: |
| 83 | |
| 84 | ```json |
| 85 | { "mcpServers": { "g1t": { "url": "https://mcp.g1t.sh", |
| 86 | "headers": { "Authorization": "Bearer ${env:G1T_TOKEN}" } } } } |
| 87 | ``` |
| 88 | |
| 89 | Without the header, a client that supports MCP authorization signs the |
| 90 | person in through their browser instead (Claude Code: `/mcp`, then |
| 91 | choose g1t; Codex: `codex mcp login g1t`; OpenCode: `opencode mcp auth |
| 92 | g1t`; Cursor: when it first connects). The MCP server always needs one |
| 93 | or the other. |
| 94 | |
| 95 | 5. **Create a workspace** if `GET /user` shows none. A workspace owns |
| 96 | repositories and is the first part of their address. Ask the person what |
| 97 | to call it; their username is a sensible default. |
| 98 | |
| 99 | ```sh |
| 100 | curl -X POST https://api.g1t.sh/workspaces \ |
| 101 | -H "Authorization: Bearer $G1T_TOKEN" -H "Content-Type: application/json" \ |
| 102 | -d '{"slug": "WORKSPACE"}' |
| 103 | ``` |
| 104 | |
| 105 | 6. **Or import one.** `POST /repos` with `name` and |
| 106 | `import_url` (the https address of a public repository, such as one on |
| 107 | GitHub) copies its default branch. |
| 108 | |
| 109 | 7. **Push a repository.** Pushing to a repository that does not exist, in a |
| 110 | workspace the person belongs to, creates it, public by default. |
| 111 | |
| 112 | ```sh |
| 113 | git remote add g1t https://g1t.sh/WORKSPACE/REPO.git |
| 114 | git -c credential.helper= \ |
| 115 | -c "http.extraHeader=Authorization: Basic $(printf '%s' "USERNAME:$G1T_TOKEN" | base64)" \ |
| 116 | push -u g1t main |
| 117 | ``` |
| 118 | |
| 119 | Or let git ask: the username is the g1t username and the password is the |
| 120 | token. |
| 121 | |
| 122 | 8. **Record Claude Code sessions automatically** (optional). This installs |
| 123 | hooks that record prompts, tool calls and replies onto the g1t pull |
| 124 | request for the branch being worked on. The person runs it, because it |
| 125 | signs them in through their browser: |
| 126 | |
| 127 | ```sh |
| 128 | curl -fsSL https://g1t.sh/install/claude.sh | sh |
| 129 | ``` |
| 130 | |
| 131 | ## Do work |
| 132 | |
| 133 | Issues and pull requests are addressed by repository and number, and share |
| 134 | one sequence of numbers: `#12` is one or the other. Below, `{repo}` stands |
| 135 | for `/repos/{owner}/{name}`. |
| 136 | |
| 137 | - **Find work:** `GET {repo}/issues?state=open`, optionally `&label=bug`. |
| 138 | - **Open an issue:** `POST {repo}/issues` with `title`, `body`, and |
| 139 | optional `labels` (such as `bug` or `feature`; a new name makes a new |
| 140 | label). Say what done means in the body, under `## Definition of done` |
| 141 | if you like; it guides whoever does the work but never gates a merge. |
| 142 | The old `checks` field is deprecated: its commands are added to the body |
| 143 | under "Definition of done" and the response has a `deprecation` note. |
| 144 | - **Read an issue:** `GET {repo}/issues/{number}`. It lists every pull |
| 145 | request already made for it. A closed issue's `resolved_by` is the number |
| 146 | of the pull request that was merged. |
| 147 | - **Open a pull request:** `POST {repo}/pulls` with `issue` (its number) and |
| 148 | `agent` (a label such as `claude-code`). Without an issue, send `title`. |
| 149 | The response has `pull.number` and `git.remote`, the pull request's own |
| 150 | fork. Clone it, commit, and push to it with the token. It starts as a |
| 151 | draft. If the change is already on a branch pushed to the repository, |
| 152 | send `branch` (and `title`, `body`) instead: no fork is made and the pull |
| 153 | request is ready at once. |
| 154 | - **Record the session** as you work, so people can see why a change was |
| 155 | made: `POST {repo}/pulls/{number}/session` with |
| 156 | `{"entries": [{"kind": "message", "text": "…"}]}`. Kinds are `prompt`, |
| 157 | `message`, `tool_call`, `tool_result`, `note`. Never include secrets; |
| 158 | sessions are as visible as the repository. |
| 159 | - **Mark it ready:** `POST {repo}/pulls/{number}/ready` with `summary`, which |
| 160 | becomes the pull request's description. |
| 161 | - **See what a pull request changes:** `GET {repo}/pulls/{number}/changes`. |
| 162 | - **Before going far**, read `overlaps` on `GET {repo}/pulls/{number}`: |
| 163 | other pull requests in progress changing the same files. `behind` says |
| 164 | whether main has moved since; if so, pull main into the fork and push. |
| 165 | - **Checks:** the repository's workflows (`.g1t/workflows`, GitHub Actions |
| 166 | syntax) run on every pull request's head, and each reports a check named |
| 167 | after the workflow, such as `CI`. Before you push, run the same tests and |
| 168 | linters those workflows run. `GET {repo}/pulls/{number}` returns |
| 169 | `statuses` and `required_checks`: each check the default branch |
| 170 | requires, as `success`, `failure`, `pending` or `expected` (not reported |
| 171 | yet). If one failed, read why with `GET {repo}/actions/runs/{id}` and |
| 172 | `GET {repo}/actions/jobs/{job}/logs`, push a fix, and the workflows run |
| 173 | again. `GET {repo}/check-names` lists the check names seen in the last |
| 174 | 30 days; `required_checks` on `PATCH {repo}/settings` sets which ones a |
| 175 | merge needs. |
| 176 | - **Comment** on an issue or a pull request: |
| 177 | `POST {repo}/issues/{number}/comments` with `body`. On a pull request, add |
| 178 | `path` and `line` to comment on one line of the change. |
| 179 | - **Review** someone else's pull request: |
| 180 | `POST {repo}/pulls/{number}/reviews` with `verdict` (`approve` or |
| 181 | `request_changes`) and `body`. |
| 182 | - **Merge** (the Write role or higher on the repository): |
| 183 | `POST {repo}/pulls/{number}/merge`. This closes the issue it was for and |
| 184 | closes the other pull requests for that issue as superseded; send |
| 185 | `{"keep_issue_open": true}` if this is only part of the work. If main has |
| 186 | moved, g1t brings the pull request up to date and lands it when that is |
| 187 | done. A repository that requires pull requests to be up to date answers |
| 188 | `409` instead: pull main from `https://g1t.sh/{owner}/{name}.git` into the |
| 189 | fork, push, and merge again. |
| 190 | With the merge queue on, merging adds the pull request to the queue |
| 191 | instead; `GET {repo}/queue` shows it being tested with the pull requests |
| 192 | ahead of it, and it lands only if that combination passes. |
| 193 | |
| 194 | ## Hand work to g1t |
| 195 | |
| 196 | Agents, workflows and the merge queue run on g1t's machines, so they |
| 197 | need a paid workspace, or the one-time $5 trial after a card check. |
| 198 | Deployments need the plan; the trial never covers them. Workflows and the merge queue on public repositories |
| 199 | can also run from g1t's open-source pool, after the same card check. |
| 200 | Agents never run from the pool. Workflow jobs with `runs-on: self-hosted` |
| 201 | run on the workspace's own machines (`g1t-runner`, any OS) at $0, on every |
| 202 | plan; a workspace can send agent work there too. Each workspace decides how its agents |
| 203 | reach a model: its own provider (connected under Integrations, billed by |
| 204 | the provider) or g1t's hosted models (while payments are in test mode, |
| 205 | only for a few invited workspaces; a trial does not open them, and an |
| 206 | agent assigned without a model is refused with `no_model`); the sandbox is g1t's unless the work goes to |
| 207 | the workspace's own runners. |
| 208 | When the plan refuses a start, these calls answer with a failure whose |
| 209 | message says what to do and where (such as `/acme/-/billing`). When every |
| 210 | agent slot of the workspace is busy, the message starts "Waiting for a |
| 211 | free slot" and the work starts by itself when one finishes. |
| 212 | |
| 213 | - **Hand off an outcome:** `POST {repo}/plans` with `brief`: what should be |
| 214 | true when the work is done. A planner reads the repository and proposes |
| 215 | issues, each with what done means (`done`), the files it touches, and what it depends |
| 216 | on. Read it with `GET {repo}/plans/{plan}` until `status` is `ready` |
| 217 | (a minute or two), then `POST {repo}/plans/{plan}/apply` with |
| 218 | `{"assign": true}`. Agents start at once on every issue that depends on |
| 219 | nothing and on the rest as what they depend on lands. `keep` opens only |
| 220 | some of the issues, by position counting from 1. |
| 221 | - **Assign one issue:** `POST {repo}/issues/{number}/assign`. The agent |
| 222 | opens a pull request, waits for the repository's workflows on it and is |
| 223 | sent back with the failing jobs' log tails when one fails, is reviewed by |
| 224 | a second agent, revises, and catches up when main moves. After its |
| 225 | revisions (`max_revisions`, 2 by default) only a required check still |
| 226 | failing holds it for a person. There is no model or |
| 227 | agent count to choose: to put more agents to work, assign more issues. |
| 228 | On g1t's hosted models, g1t routes each piece of work to a small or a |
| 229 | large tier: planning, catching up and reviews of small changes that |
| 230 | touch no sensitive path run small; making changes, other reviews, and |
| 231 | any retry after a failed attempt run large. |
| 232 | - **Who a g1t pull request is for:** g1t is the `author` (`username` |
| 233 | `g1t`, `kind` `agent`) of every pull request it makes and every issue it |
| 234 | files at work; `requested_by` is the person who asked (null when nobody |
| 235 | did, as for a security update). That person answers for it as an author |
| 236 | would: they may update, close and steer it without Triage, cannot |
| 237 | approve it, are never asked to review it, see it in their own lists, and |
| 238 | its sandboxes, workflows and previews are trusted as they are. Webhooks |
| 239 | carry `data.author` and `data.requested_by`; Actions payloads |
| 240 | `pull_request.user` (a `Bot`) and `pull_request.requested_by`. |
| 241 | - **Put an agent on something in one step:** `POST {repo}/issues/delegate` |
| 242 | with `title` and `body` (what to do, in plain words, and what done |
| 243 | means if you know it). It opens the issue and assigns g1t at once; it needs the |
| 244 | Write role, and nothing opens without it. The issue opens even when the |
| 245 | agent cannot start: `agent.status` is `started` (with `pull`), `queued`, |
| 246 | or `not_started` with `agent.code` (`not_paid`, `trial_used`, `limit`, |
| 247 | `paused`, `issue_cap`, `billing_unavailable`, `no_model`), `agent.message` |
| 248 | and `agent.fix_url`. |
| 249 | - **How sure g1t is of a change:** once g1t finishes, the pull |
| 250 | request's `confidence` is `high`, `medium` or `low` with short `reasons` |
| 251 | ("tests not added", "3 revisions"), from its required checks, revisions, review, |
| 252 | tests, size, reach, guardrails and unanswered questions. The agent's own |
| 253 | word (`self_reported`, `uncertain_about`) can only lower it. With the |
| 254 | repository setting `hold_low_confidence` on (the default), a change rated |
| 255 | low waits for a person's approval instead of merging by itself. |
| 256 | - **Steer a working agent:** `POST {repo}/pulls/{number}/messages` with |
| 257 | `body`. It reads the message at its next step. |
| 258 | - **g1t's runs talk to each other.** g1t asks the agent on another |
| 259 | pull request a question, or hands it work, with `agent` `message` |
| 260 | (`kind` `question` or `handoff`, and `from_number`, its own pull |
| 261 | request). The other agent replies with `agent` `answer` |
| 262 | (`POST {repo}/messages/{id}/answer`); one that is not at work is woken |
| 263 | to answer, in its own pull request's sandbox. Plans show these exchanges under |
| 264 | "Agents talking". From any other caller, `agent` `message` sends a plain |
| 265 | message. |
| 266 | |
| 267 | Every one of these is also on the MCP server. Its tools are resources, |
| 268 | each with an `action`: `search`, `repository`, `issue`, `pull_request`, |
| 269 | `agent`, `plan`, `memory`, `workflow`, `secret`, `webhook`, `access`, |
| 270 | `workspace` and `account`. Call `tools/call` with the tool's name and |
| 271 | `arguments` holding `action` and its inputs, such as |
| 272 | `{"name": "issue", "arguments": {"action": "get", "repo": "acme/web", "number": 12}}`. |
| 273 | The flow above is: `issue` `get`, `memory` `recall`, `pull_request` |
| 274 | `create` (with `issue`), push, `pull_request` `record_session` as you go, |
| 275 | `pull_request` `ready` with `summary`; read `overlaps`, `behind`, |
| 276 | `statuses` and `required_checks` on `pull_request` `get`, and |
| 277 | `repository` `check_names` for the names a branch can require. `agent` `delegate` and `agent` `assign` hand work |
| 278 | to g1t's agent; `plan` `create`, `get` and `apply` plan an outcome; |
| 279 | `memory` `remember` saves a fact. `search` runs `code` and `account` runs |
| 280 | `whoami` when `action` is left out. A call missing a required field says |
| 281 | which, such as "issue.get needs number.". The earlier one-tool-per-operation |
| 282 | names (`get_issue`, `create_pull_request`, …) still answer for now but are |
| 283 | no longer listed. Every tool and action, with its required fields and |
| 284 | scope: https://docs.g1t.sh/reference/mcp/ |
| 285 | |
| 286 | g1t's own token can never change a repository's details, rename it |
| 287 | or its branches, make it public or private, archive, transfer, delete, |
| 288 | restore or purge it, or delete a workspace. MCP tools take the repository |
| 289 | as `repo`, written `owner/name`. |
| 290 | |
| 291 | ## Scopes |
| 292 | |
| 293 | Every access token and OAuth sign-in has scopes, `resource:level`: |
| 294 | `repo`, `code`, `issues`, `pull_requests`, `workflows`, `memory`, |
| 295 | `account`, `access`, `webhooks`, `secrets`, `runners` (read, write or admin |
| 296 | as each has them), `agents:run`, `workspace:read` and `workspace:admin`. A higher |
| 297 | level includes the lower. A token may expire. It reaches every workspace |
| 298 | and repository its owner can (a workspace's token, that workspace only); |
| 299 | what a call may do is the owner's role and the token's scopes together. |
| 300 | A token sees only the MCP tools and actions its scopes allow. A missing scope answers `403` with |
| 301 | `{"error": {"code": "forbidden", "message": "This access token needs the issues:write scope to use create_issue.", "needed_scope": "issues:write"}}`. |
| 302 | Pushing needs `code:write`; cloning a private repository `code:read`. For |
| 303 | an agent, use the Agent preset (every read scope but `runners:read`, plus `code:write`, |
| 304 | `issues:write`, `pull_requests:write`, `agents:run`, `memory:write`). |
| 305 | OAuth clients may send `scope`; |
| 306 | the person can untick any; asking for none gives the Agent preset. Tokens |
| 307 | from device sign-in (above) have full access. Guide: |
| 308 | https://docs.g1t.sh/guides/authentication/#scopes |
| 309 | |
| 310 | ## Access and roles |
| 311 | |
| 312 | Everyone's access to a repository is a role: `read` (read, clone, open |
| 313 | issues and pull requests, comment), `triage` (also label, assign, close), |
| 314 | `write` (also push, merge, and put agents to work: anything that spends |
| 315 | compute), `maintain` (also settings, branch protection, guardrails) or |
| 316 | `admin` (also webhooks, secrets, deployments, domains, who has access, |
| 317 | rename, archive, visibility, default branch). Owners of a workspace have |
| 318 | admin on all of its repositories and alone transfer or delete them; |
| 319 | members get the workspace's base permission (write unless owners change |
| 320 | it); anyone can be given a role on one repository, as an outside |
| 321 | collaborator; anyone reads a public repository. The highest wins. A |
| 322 | private repository you cannot read answers `404`; one you can read but |
| 323 | lack the role for answers `403` naming the role needed. An agent works |
| 324 | with the role of the person it acts for on its repository, never more |
| 325 | than `write`, and its token can never change who has access. An outside |
| 326 | collaborator with `write` can put agents to work; the runs are charged to |
| 327 | the repository's workspace, and their agents are told the project's memory, |
| 328 | never the workspace's. Who can do what elsewhere: deployments are seen with |
| 329 | `read` (on a public repository, by anyone, build logs included), deployed |
| 330 | with `write`, configured (settings, domains) with `admin`; project settings |
| 331 | and dependencies need `maintain`; repository webhooks, secrets and |
| 332 | variables need `admin`, seeing them included; security alerts need |
| 333 | `write` (dismissing a dependency alert too), dismissing or reopening a |
| 334 | secret alert `admin`, turning security updates on or off `maintain`; |
| 335 | enabling or disabling a workflow needs `maintain`; plans and project memory |
| 336 | are read by anyone who can read the repository, and project memory is |
| 337 | changed with `write`; workspace memory is for members. People: the |
| 338 | workspace's Settings → Members (`g1t.sh/<owner>/-/people`, with an Outside |
| 339 | collaborators tab and the Base permission for owners); a repository's |
| 340 | Settings → Access (`g1t.sh/<owner>/<repo>/settings/access`); invitations |
| 341 | are answered at `g1t.sh/<owner>/<repo>/invitations`. |
| 342 | `GET {repo}/collaborators/{username}/permission` gives a role and what it |
| 343 | allows. Guide: https://docs.g1t.sh/guides/access-and-roles/ |
| 344 | |
| 345 | ## Manage a repository |
| 346 | |
| 347 | People with the admin role rename it (`POST {repo}/rename` with `name`; the |
| 348 | old address redirects), make it public or private |
| 349 | (`POST {repo}/visibility` with `private` and its full name in `confirm`), |
| 350 | archive or unarchive it (`POST {repo}/archive`, `POST {repo}/unarchive`), |
| 351 | and owners of its workspace delete it (`DELETE {repo}` with its full name |
| 352 | in `confirm`). A deleted |
| 353 | repository can be restored for 30 days (`POST {repo}/restore`, listed by |
| 354 | `GET /workspaces/{workspace}/repos/deleted`) and is then purged; its name |
| 355 | stays taken until then, or until `POST {repo}/purge`. Maintain changes the |
| 356 | description, `website` and `topics` with `PATCH {repo}`, admin the |
| 357 | `default_branch`, and write renames branches with |
| 358 | `POST {repo}/branches/{branch}/rename` and `new_name` (slashes in the |
| 359 | branch URL-encoded); only admin renames the default branch. An archived |
| 360 | repository is read-only: pushes and merges are refused, issues and pull |
| 361 | requests are locked, and agents and workflows do not run on it. |
| 362 | |
| 363 | ## Integrations |
| 364 | |
| 365 | A workspace's owners connect it to outside systems on its **Integrations** |
| 366 | page, or with `POST /workspaces/{workspace}/integrations`: |
| 367 | |
| 368 | - **Its own model providers** (`anthropic`, `openai`, `gemini`, `xai`, |
| 369 | `mistral`, `deepseek`, `azure_openai`, `openrouter`, `groq`, `together`, |
| 370 | `fireworks`, `cerebras`, `anthropic_endpoint`, `openai_endpoint`), as many |
| 371 | as it uses, with each |
| 372 | kind of work routed to one of them or to g1t's hosted models |
| 373 | (`PUT /workspaces/{workspace}/model-routes`). Those providers bill the |
| 374 | workspace; g1t charges only each run's sandbox time, at cost plus 20% |
| 375 | (nothing on the workspace's own runners). Sandboxes never hold a key. |
| 376 | - **Alerts** (`sentry`, `datadog`, `webhook`): each problem opens one issue |
| 377 | in a chosen repository, optionally with an agent put on it at once. |
| 378 | Senders sign requests to `https://api.g1t.sh/hooks/{integration}`. |
| 379 | - **Trackers** (`jira`, `linear`): `GET {repo}/context?reference=TECH-1234` |
| 380 | fetches a ticket; `POST {repo}/issues/import` with `reference` (and |
| 381 | `assign`) opens a linked issue. Agents get tickets their work mentions in |
| 382 | their starting context. Ticket text is reference material, never |
| 383 | instructions. |
| 384 | |
| 385 | ## Webhooks |
| 386 | |
| 387 | `POST {repo}/hooks` (or `/workspaces/{workspace}/hooks` for every |
| 388 | repository in a workspace) with `url` and optional `events` sends events |
| 389 | to that HTTPS address as they happen, signed in `X-G1t-Signature-256` |
| 390 | (HMAC-SHA256 of the body), retried for about seven hours. Deliveries, |
| 391 | with request and response, are at `…/hooks/{id}/deliveries`. |
| 392 | |
| 393 | ## GitHub Actions |
| 394 | |
| 395 | GitHub Actions workflows run on g1t unchanged, from `.g1t/workflows/` |
| 396 | (g1t never reads `.github`): moving a repository is `git mv .github .g1t`. |
| 397 | Runs, jobs and logs are at GitHub's own routes under |
| 398 | `{repo}/actions/...`. A run on a pull request's head is a check: pending |
| 399 | holds the merge, failure refuses it and sends g1t back to fix it. |
| 400 | Secrets and variables are one list per repository (site: |
| 401 | `g1t.sh/<owner>/<repo>/settings/secrets`) and per workspace: each row is a |
| 402 | key, Secret or Config, the environments it applies to (all, or e.g. |
| 403 | production/preview, or a job's `environment:`), and whether workflows, |
| 404 | deployments or both read it. API: `{repo}/actions/secrets` and |
| 405 | `{repo}/actions/variables` (GitHub's routes) with extra `environments`, |
| 406 | `available_to`, `repositories`, `note`, `id`. Trusted jobs get |
| 407 | `secrets.G1T_TOKEN` (the workspace's token; `GITHUB_TOKEN` is its alias), |
| 408 | which cannot change secrets. A pull request's runs and preview are trusted |
| 409 | only when its author has `write` or higher on the repository (a member or |
| 410 | an outside collaborator), or is g1t working on its own; for one g1t made, |
| 411 | the role of whoever asked for it (`requested_by`) counts. Anyone else's run |
| 412 | with config only. Guide: |
| 413 | https://docs.g1t.sh/guides/secrets-and-variables/ |
| 414 | |
| 415 | Self-hosted runners: a job with `runs-on: self-hosted` (or |
| 416 | `[self-hosted, linux, gpu]`, or `{group: name}`) waits until a runner of the |
| 417 | workspace's with every label takes it. Owners add one under |
| 418 | `g1t.sh/<workspace>/-/runners`: a one-hour registration token, then |
| 419 | `g1t-runner register --url https://g1t.sh --token g1trt_…` and |
| 420 | `g1t-runner run`. Runners only connect out. API: |
| 421 | `/workspaces/{workspace}/actions/runners`, `.../runner-groups`, |
| 422 | `.../runner-settings` (and the same under `{repo}/actions/` for a |
| 423 | repository's own); MCP: the `workflow` tool's `list_runners`, |
| 424 | `create_runner_token`, `remove_runner`, runner group and settings actions |
| 425 | (`runners:read`/`runners:admin`). Pull requests from forks never run on them |
| 426 | unless allowed. Guide: https://docs.g1t.sh/guides/self-hosted-runners/ |
| 427 | |
| 428 | ## Projects |
| 429 | |
| 430 | A project is what a workspace builds and runs; every repository is a |
| 431 | project of its own name (`g1t.sh/<owner>/<project>` opens its overview; its |
| 432 | code is under `/code`; every repository address still works). Deployments, |
| 433 | secrets and variables belong to the project; branches, pull requests, |
| 434 | review and merge rules to its repository (Settings → Repository). Guide: |
| 435 | https://docs.g1t.sh/guides/projects/ |
| 436 | |
| 437 | ## Security |
| 438 | |
| 439 | A push that adds a known key or token format (AWS, GitHub, GitLab, Stripe |
| 440 | live, Slack tokens and webhooks, Google, Anthropic, OpenAI, npm, g1t, |
| 441 | SendGrid, PEM private keys, service-role JWTs) is refused with every secret |
| 442 | listed by `file:line` in git's output and a link to allow it; this includes |
| 443 | an agent's push to its pull request. A very large push is scanned after it |
| 444 | lands, not before: it goes through, its new commits (any branch) are |
| 445 | scanned in the background, and a secret found is an open alert, emailed to |
| 446 | the workspace's owners when it looks real. History is scanned once in the |
| 447 | background. Never commit a secret: read it from the environment. Values are |
| 448 | judged by the value alone, never the file's path: a documented example key, |
| 449 | a value containing example/sample/dummy/fake/placeholder/changeme/notreal/ |
| 450 | redacted/xxxxx, one that counts up (six or more, like 123456), one |
| 451 | character five or more times, a repeated short piece, or too little |
| 452 | randomness is a "likely test value": listed apart, never blocks a push, |
| 453 | never counted critical. Any other fixture carries `g1t:allow-secret` in a |
| 454 | comment on its line. Alerts are `open`, `dismissed` or `fixed`. Dismissing a |
| 455 | secret alert needs `admin`, with a reason (`false_positive`, |
| 456 | `used_in_tests`, `wont_fix`: dismissed, and pushes carrying it go through; |
| 457 | `revoked`: fixed) and an optional comment (500 characters); a dependency |
| 458 | alert needs `write` (`fix_started`, `no_bandwidth`, `tolerable_risk`, |
| 459 | `inaccurate`, `not_used`). Reopen undoes it. API: |
| 460 | `GET {repo}/security/alerts` (`state`, `kind`), |
| 461 | `POST {repo}/security/alerts/{id}/dismiss` (`reason`, `comment`), |
| 462 | `POST {repo}/security/alerts/{id}/reopen`; MCP `repository` actions |
| 463 | `security_alerts`, `dismiss_alert`, `reopen_alert` (`repo:read` to list, |
| 464 | `repo:admin` to dismiss or reopen). Lockfiles (npm, pnpm, yarn, Cargo, Go, |
| 465 | Python) on the default branch are checked against OSV on every push to it |
| 466 | and daily. Security updates (on by default; `maintain` turns them off): for |
| 467 | each vulnerable dependency with a fix, g1t itself opens a pull request |
| 468 | authored by `g1t` from `g1t/security/<package>-<version>`, raising the |
| 469 | version in each lockfile with the ecosystem's own tool; it merges through |
| 470 | the branch's required checks and merge queue. A newer update for the same |
| 471 | package, or the package no longer being vulnerable, closes it as |
| 472 | superseded. Only when the bump fails, or required checks fail because code |
| 473 | must change, does g1t open an issue and assign it to g1t (the session |
| 474 | shows "started by g1t"). With no fix published, the alert links the |
| 475 | advisory and is checked again daily. `.g1t/dependencies.yml` (version |
| 476 | updates) is read and validated, but no version update pull requests are |
| 477 | opened yet. `g1t` is not an account and cannot be signed in to. |
| 478 | Guide: https://docs.g1t.sh/guides/security/ |
| 479 | |
| 480 | ## Deployments |
| 481 | |
| 482 | Part of the g1t plan ($20 a month per workspace, started by an owner |
| 483 | under the workspace's Billing). No quotas: unlimited projects and |
| 484 | previews (never charged); builds by the second, requests ($0.36/M), CPU |
| 485 | ($0.024/M ms) and custom domains ($0.12 a month each) metered from the |
| 486 | first at cost + 20%, from the plan's $10 first. The trial |
| 487 | never covers deployments. Then someone with admin on the repository |
| 488 | turns deployments on for a project (Settings → Deployments, or Deploy on |
| 489 | its overview). Production deploys from the default branch to |
| 490 | `https://<project>-<owner>.g1t.page` on each push; every branch with an |
| 491 | open pull request gets a preview at |
| 492 | `https://<project>-git-<branch>-<owner>.g1t.page` (a fork's pull request is |
| 493 | `pr-<n>`), shown on it as the check `g1t / deploy` (`g1t / deploy (<project>)` |
| 494 | for a workspace's other projects). Builds and running apps |
| 495 | read the project's secrets and variables available to Deployments, each |
| 496 | key's Production or Preview row. Workers projects (`wrangler.jsonc`) and |
| 497 | static sites build without configuration. Previews come down when the pull |
| 498 | request closes and after idle days. There is no API for deployments yet. |
| 499 | Guide: https://docs.g1t.sh/guides/deployments/ |
| 500 | |
| 501 | ## Search |
| 502 | |
| 503 | `GET https://api.g1t.sh/search?q=<query>&type=<type>` (MCP: `search`, action `code`, the default) |
| 504 | searches all of g1t: repositories (name, description, topics, README), code |
| 505 | on default branches, issues, pull requests, people and workspaces. No token |
| 506 | needed for public results; with one, private results the token's person |
| 507 | can read are included (their workspaces' repositories, and those they were |
| 508 | given a role on), checked against current membership and roles. `type` is |
| 509 | `repositories`, `code`, `issues`, `pulls` or `people` (worked out from the |
| 510 | qualifiers when left out); `page` and `per_page` (at most 50) page through. |
| 511 | The query takes words, `"exact phrases"`, `-word` to leave out, and |
| 512 | `repo:owner/name`, `org:<workspace>`, `language:<lang>`, `path:<prefix or |
| 513 | *.glob>`, `is:issue`, `is:pr`, `is:open`, `is:closed`, `is:merged`, |
| 514 | `author:<username>`, `label:<label>`. Code search matches any run of three |
| 515 | characters or more; vendored directories, lockfiles, binaries and files |
| 516 | over 512 KB are not indexed. Results give `counts` per type and each hit's |
| 517 | `snippet` or code `lines` as parts with `highlight`. On the site: |
| 518 | `https://g1t.sh/search?q=`, ⌘K, and `https://g1t.sh/explore` for public |
| 519 | projects by activity, language (`?language=`) and topic (`?topic=`). |
| 520 | The `search` tool's `context` action stays the search of one workspace's |
| 521 | context hub. Guide: |
| 522 | https://docs.g1t.sh/guides/search/ |
| 523 | |
| 524 | ## Facts |
| 525 | |
| 526 | - API base: `https://api.g1t.sh`. `GET /` lists the main URLs as templates; |
| 527 | every operation is in the OpenAPI document. |
| 528 | Auth: `Authorization: Bearer g1t_…`. Public data needs no token. Errors are |
| 529 | `{"error": {"code": "…", "message": "…"}}` with codes `unauthenticated` |
| 530 | (401), `payment_required` (402, when the plan or a limit refuses compute), |
| 531 | `forbidden` (403, with `needed_scope` when the token lacks a |
| 532 | scope), `not_found` (404), `conflict` (409), `invalid` (422). Each |
| 533 | operation's scope is `x-scope` in the OpenAPI document. The full description is at https://api.g1t.sh/openapi.json. |
| 534 | - Git remote: `https://g1t.sh/{workspace}/{repo}.git`. In API paths, |
| 535 | `{owner}` is the workspace. Pull request forks: |
| 536 | `https://g1t.sh/pulls/{pull_request_id}.git`. SSH is not available. |
| 537 | - Limits: 1 GB per repository, 32 MB per file, 100 MB per push. Every |
| 538 | current limit, why it exists and the workaround: |
| 539 | https://docs.g1t.sh/about/limitations/ |
| 540 | - Forgotten password: https://g1t.sh/forgot (the person does this, in a |
| 541 | browser). |
| 542 | - Times are RFC 3339 in UTC. |
| 543 | - OAuth 2.1 for applications: metadata at |
| 544 | `https://api.g1t.sh/.well-known/oauth-authorization-server`; authorization |
| 545 | code with PKCE (S256), public clients, dynamic registration. |
| 546 | - A pull request whose required checks have not passed (failed, still |
| 547 | running, or not reported yet) is refused a merge with `409`, saying |
| 548 | which; where the repository allows bypassing them |
| 549 | (`allow_ignoring_checks`), someone who can merge can send |
| 550 | `{"ignore_checks": true}`. Checks that are not required never hold a |
| 551 | merge. With the merge queue on, the workflows behind required checks |
| 552 | need `merge_group` in their `on:`. |
| 553 | - Landing fast-forwards the default branch: g1t makes no merge commit on |
| 554 | main. Bringing a pull request up to date makes a merge commit on its own |
| 555 | branch. |
| 556 | - Pricing (https://g1t.sh/pricing): the forge is free. One plan, g1t, at |
| 557 | $20 a month per workspace with unlimited members, includes $10 of usage |
| 558 | at cost + 20% (unused does not roll over). Compute needs the plan or a |
| 559 | card check (never charged); the $5 trial needs a credit or debit card, |
| 560 | not a prepaid one. No quotas on the plan: everything is metered from the |
| 561 | first unit at cost + 20%, and only the spend limit stops work. Every |
| 562 | workspace has 1 GB of private storage and 50,000 git operations a month |
| 563 | free; past them, the plan pays ($0.60/GB-month, $0.18/1,000) and a free |
| 564 | workspace is held (pushes to private repositories stop; git slowed to 60 |
| 565 | an hour). Limits: $100 in a |
| 566 | paid workspace's first month, rising as payments clear; owners set a |
| 567 | spend limit, prepay, or ask with Raise my limit. Caps: $2 a run and $10 |
| 568 | an issue by default. A spend spike pauses new compute until an owner |
| 569 | chooses Keep going or Stop (`/<workspace>/-/billing`). Audit log: 90 days |
| 570 | on every plan. |
| 571 | |
| 572 | ## More |
| 573 | |
| 574 | - [Quickstart](https://docs.g1t.sh/quickstart/) |
| 575 | - [How g1t works](https://docs.g1t.sh/concepts/overview/) |
| 576 | - [Search and Explore](https://docs.g1t.sh/guides/search/) |
| 577 | - [g1t's agent](https://docs.g1t.sh/guides/working-with-g1t/) |
| 578 | - [Outcomes and plans](https://docs.g1t.sh/guides/outcomes/) |
| 579 | - [Talking to agents](https://docs.g1t.sh/guides/talking-to-agents/) |
| 580 | - [Bring your own agent](https://docs.g1t.sh/guides/bring-your-own-agent/) |
| 581 | - [The merge queue](https://docs.g1t.sh/guides/merge-queue/) |
| 582 | - [Sessions and why-blame](https://docs.g1t.sh/guides/why-blame/) |
| 583 | - [Forks and branches](https://docs.g1t.sh/concepts/forks/) |
| 584 | - [Accounts and sign-in](https://docs.g1t.sh/guides/authentication/) |
| 585 | - [Workspaces and tokens](https://docs.g1t.sh/guides/workspaces/) |
| 586 | - [Access and roles](https://docs.g1t.sh/guides/access-and-roles/) |
| 587 | - [Managing a repository](https://docs.g1t.sh/guides/managing-repositories/) |
| 588 | - [Integrations](https://docs.g1t.sh/guides/integrations/) |
| 589 | - [Model providers](https://docs.g1t.sh/guides/models/) |
| 590 | - [Webhooks](https://docs.g1t.sh/guides/webhooks/) |
| 591 | - [GitHub Actions](https://docs.g1t.sh/guides/actions/) |
| 592 | - [Self-hosted runners](https://docs.g1t.sh/guides/self-hosted-runners/) |
| 593 | - [Usage and billing](https://docs.g1t.sh/guides/usage-and-billing/) |
| 594 | - [Git](https://docs.g1t.sh/guides/git/) |
| 595 | - [MCP tools](https://docs.g1t.sh/reference/mcp/) |
| 596 | - [API reference](https://docs.g1t.sh/reference/api/) |
| 597 | - [What g1t can't do yet](https://docs.g1t.sh/about/limitations/) |
| 598 | - [An open letter to Cloudflare](https://docs.g1t.sh/about/open-letter-to-cloudflare/) |
| 599 | - [Source](https://g1t.sh/flagon-io/g1t), MIT licensed |
| 600 | |
| 601 | ## Help, status and policies |
| 602 | |
| 603 | - [Status](https://status.g1t.sh/): whether each part of g1t is working now, 90 days of uptime, and incidents; the same as JSON at https://status.g1t.sh/status.json |
| 604 | - [Support](https://g1t.sh/support): where to get help (hey@flagon.io) |
| 605 | - [Security](https://g1t.sh/security): how g1t protects code and accounts, and responsible disclosure (hey@flagon.io, https://g1t.sh/.well-known/security.txt) |
| 606 | - [Policies](https://g1t.sh/policies): [Terms of Service](https://g1t.sh/policies/terms), [Privacy Policy](https://g1t.sh/policies/privacy), [Acceptable Use](https://g1t.sh/policies/acceptable-use), [Refunds and Cancellation](https://g1t.sh/policies/refunds), [Subprocessors](https://g1t.sh/policies/subprocessors) |
| 607 | - g1t is made by Flagon, Inc. (https://www.flagon.io) |