---
title: "GitCafe"
description: "GitCafe repositories, pull requests, review threads and files in the same shapes as every other forge. Public ones read without a token."
canonical_url: "https://forges.agntn.dev/platforms/gitcafe"
---
# GitCafe

> GitCafe repositories, pull requests, review threads and files in the same shapes as every other forge. Public ones read without a token.

<platform-facts platform="gitcafe">



</platform-facts>

## Read a GitCafe repository

```ts
import { createProvider } from "@agntn/forges";

const gitcafe = await createProvider("gitcafe", {
  token: process.env.CAFE_TOKEN,
});

const repo = { owner: "versecafe", repo: "ashlar" };
const ashlar = await gitcafe.repos.get(repo);
const pull = await gitcafe.pullRequests.get({ ...repo, number: 1 });
const threads = await gitcafe.threads.list({ ...repo, number: 2 }, { state: "all" });
const manifest = await gitcafe.repos.readContents(repo, { path: "package.json" });
```

GitCafe IDs have prefixes, like `repo_01kt3jc1ktfcf8nrrqrqs1wf0d`. Issue and pull request numbers stay plain numbers. No prefix there.

Looking for page numbers? Every list uses a `next` token in the response body. forges returns it as `nextCursor`.

The default API base is `https://git.cafe/api`. forges adds `/api` when it's missing. The MCP server and Pi/OMP extensions read `FORGES_GITCAFE_BASE_URL`.

### Where does the token come from?

`@agntn/credentials/gitcafe` checks these sources in order:

1. An explicit `{ token }`.
2. `CAFE_TOKEN`.
3. The `cafe` CLI's login helper, `cafe auth http credential get`.
4. `gitcafe/credentials.json` under the XDG config directory.

Run `cafe auth login` to save a login. An expired saved login is skipped.

A `gct_` personal access token comes from GitCafe Settings, Tokens. It's sent as a Bearer token. GitCafe MCP tokens don't work on the REST API.

Pass `{ token: "" }` to read public repositories anonymously. `users.authenticated` needs a token.

## What it reads

Endpoints are relative to `/api`. Here, `…` means `/repos/:owner/:repo`.

<table>
<thead>
  <tr>
    <th>
      Resource
    </th>
    
    <th>
      Endpoint
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Repositories and tags
    </td>
    
    <td>
      <code>
        GET …/
      </code>
      
      , <code>
        GET /explore/repos?owner=
      </code>
      
      , <code>
        GET …/refs?kind=tags
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Issues
    </td>
    
    <td>
      <code>
        GET …/issues
      </code>
      
      , <code>
        GET …/issues/:number
      </code>
      
      , <code>
        GET …/issues/:number/comments/
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Pull requests
    </td>
    
    <td>
      <code>
        GET …/pulls
      </code>
      
      , <code>
        GET …/pulls/:number
      </code>
      
       with its labels, assignees and reviewers, <code>
        GET …/pulls/:number/comments/
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Commits
    </td>
    
    <td>
      <code>
        GET …/commits
      </code>
      
      , <code>
        GET …/commit?oid=
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Repository contents
    </td>
    
    <td>
      <code>
        GET …/commit?ref=
      </code>
      
       to resolve, then <code>
        GET …/blob
      </code>
      
      , <code>
        GET …/tree
      </code>
      
       or <code>
        GET …/raw
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      CI runs
    </td>
    
    <td>
      <code>
        GET …/actions/runs
      </code>
    </td>
  </tr>
</tbody>
</table>

## What comes back

- Inline pull request comments group into threads with a path and line. A thread is resolved when GitCafe sets `resolvedAt`.
- Reply, resolve and unresolve use the adapter and need a token. The upstream adapter marks GitCafe writes as unverified.
- Issue and pull request events contain comments only. Pull request checks and commit checks read GitCafe's checks.
- GitCafe stacks pull requests, but forges serves each cup separately. Each reads as a regular pull request with its own `sourceBranch` and `targetBranch`.
- A bare ref tries a branch first, then a tag. A full SHA, all 40 hex characters, is a commit.
- File reads resolve the ref to a commit first. Binary bytes come from `/raw` when `/blob` returns null content.

## Gotchas

What happens when a path is a directory?

- A `/blob` response with status 400 and code `invalid` sends forges to `/tree`. The root goes straight to `/tree`.
- Directory listings cover one level and report `size: null`. After 10 pages of 200 rows, `entriesComplete` is false. Files over 1 MiB get a 413.
- Owner `repos.list` rejects `perPage` over 50 with a 400 before any request. Other lists keep the usual 1 to 100.
- `commits.list` filters by ref only. `path`, `since` and `until` get a 501 before any request. The whole history masquerading as filtered results is garbage.
- `ciRuns.list` reads Actions runs and filters by branch. A workflow filter gets a 501 before any request.
- The explorer at forges.agntn.dev doesn't run GitCafe. Pi and OMP recognize `https://git.cafe/owner/repo` remotes.

## What isn't there

These operations return 501 with a sentence, rather than pretending to work.

Releases are marked not applicable by the upstream adapter. GitCafe does have a `/releases` API. Commit comparison is also out: `/compare` lists changed files, not commits.

Commit patches, code search, issue search, pull request search and commit search return 501. So do reactions, pull request reviews listing, issue types and fields, sub issues and contribution templates.

`ciRuns.listJobs` and job logs return 501 too.

## Where it lives

`GitCafeProvider` lives in `src/providers/gitcafe.ts`. Import it from `@agntn/forges/gitcafe`. It uses the upstream `forges/gitcafe` adapter and `@agntn/credentials/gitcafe`.


## Sitemap

See the full [sitemap](https://forges.agntn.dev/sitemap.md) for all pages.
