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
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:
- An explicit
{ token }. CAFE_TOKEN.- The
cafeCLI's login helper,cafe auth http credential get. gitcafe/credentials.jsonunder 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.
| Resource | Endpoint |
|---|---|
| Repositories and tags | GET …/, GET /explore/repos?owner=, GET …/refs?kind=tags |
| Issues | GET …/issues, GET …/issues/:number, GET …/issues/:number/comments/ |
| Pull requests | GET …/pulls, GET …/pulls/:number with its labels, assignees and reviewers, GET …/pulls/:number/comments/ |
| Commits | GET …/commits, GET …/commit?oid= |
| Repository contents | GET …/commit?ref= to resolve, then GET …/blob, GET …/tree or GET …/raw |
| CI runs | GET …/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
sourceBranchandtargetBranch. - 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
/rawwhen/blobreturns null content.
Gotchas
What happens when a path is a directory?
- A
/blobresponse with status 400 and codeinvalidsends forges to/tree. The root goes straight to/tree. - Directory listings cover one level and report
size: null. After 10 pages of 200 rows,entriesCompleteis false. Files over 1 MiB get a 413. - Owner
repos.listrejectsperPageover 50 with a 400 before any request. Other lists keep the usual 1 to 100. commits.listfilters by ref only.path,sinceanduntilget a 501 before any request. The whole history masquerading as filtered results is garbage.ciRuns.listreads 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/reporemotes.
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.