Platforms

GitCafe

GitCafe repositories, pull requests, review threads and files in the same shapes as every other forge. Public ones read without a token.
IDgitcafe07 / 09git.cafe/api
Platform / gitcafe

GitCafe

Spoken by GitCafeProvider. Same resources, same shapes, its own quirks kept inside.

Access

CreatecreateProvider("gitcafe")

Importimport { GitCafeProvider } from"@agntn/forges/gitcafe"

EnvCAFE_TOKEN

CLIcafe auth login

Config~/.config/gitcafe/credentials.json

Header
Authorization: Bearer
Anonymous
public repositories, everything but your own profile
Threads
inline comments, resolvable
Code search
unsupported, explicit error
Templates
none

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.

ResourceEndpoint
Repositories and tagsGET …/, GET /explore/repos?owner=, GET …/refs?kind=tags
IssuesGET …/issues, GET …/issues/:number, GET …/issues/:number/comments/
Pull requestsGET …/pulls, GET …/pulls/:number with its labels, assignees and reviewers, GET …/pulls/:number/comments/
CommitsGET …/commits, GET …/commit?oid=
Repository contentsGET …/commit?ref= to resolve, then GET …/blob, GET …/tree or GET …/raw
CI runsGET …/actions/runs

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.