Skip to main content

Forgejo

@shrug/forgejov2026.07.17.1· 14d agoMODELS
01README

Query Forgejo and Gitea instances from swamp over their shared /api/v1 REST surface, authenticated with a personal access token — a read-only swamp node for a self-hosted git forge.

Every method persists a typed, CEL-referenceable snapshot. Per-repo snapshots are keyed owner__repo (single issues/PRs add __<index>):

data.latest("forgejo", "shrug__infra").attributes.issues
data.latest("forgejo", "neil__aoc2024__12").attributes

Methods

  • list_repos — repositories accessible to the authenticated user.
  • get_repo — details for one repository.
  • list_issues — issues for a repo (pins type=issues, so pull requests are excluded), filterable by open / closed / all.
  • get_issue — a single issue by number.
  • list_pulls — pull requests for a repo, filterable by state.
  • get_pull — a single PR by number (populates additions / deletions / changed_files, which the list endpoint omits).
  • list_releases — releases for a repo.

Security

  • token is a sensitive global argument — wire it from a vault at model-create time, never inline it.
  • The token is sent as an Authorization: token … header and is never logged.

Quickstart

swamp vault put forgejo token           # hidden prompt
swamp model create @shrug/forgejo forgejo \
  --global-arg host=https://git.shrug.pw \
  --global-arg token='${{ vault.get(forgejo, token) }}'

swamp model method run forgejo list_repos
swamp model method run forgejo list_issues --arg owner=shrug --arg repo=infra

Known limitations

  • List methods expose page / limit but do not auto-paginate.
  • No rate-limit backoff: a 429 throws immediately.
  • Read-only: no create/edit/merge/delete paths yet.
02Models1
@shrug/forgejov2026.07.17.1forgejo.ts

Global Arguments

ArgumentTypeDescription
hoststringForgejo or Gitea instance URL (e.g. https://codeberg.org). No trailing slash.
tokenstringPersonal access token for the Forgejo/Gitea instance.
metadatarecord
fn list_repos()
List repositories owned by or accessible to the authenticated user.
fn get_repo(owner: string, repo: string)
Get details for a specific repository.
ArgumentTypeDescription
ownerstringRepository owner (user or org login).
repostringRepository name.
fn list_issues(state: enum)
List issues for a repository.
ArgumentTypeDescription
stateenumFilter by issue state.
fn get_issue(index: number)
Get a specific issue by number.
ArgumentTypeDescription
indexnumberIssue number.
fn list_pulls(state: enum)
List pull requests for a repository.
ArgumentTypeDescription
stateenumFilter by pull request state.
fn get_pull(index: number)
Get a specific pull request by number.
ArgumentTypeDescription
indexnumberPull request number.
fn list_releases()
List releases for a repository.

Resources

repos(1h)— Repositories accessible to the authenticated user
repo(1h)— Details for a single repository
issues(30m)— Issues for a repository
issue(30m)— A single issue
pulls(30m)— Pull requests for a repository
pull(30m)— A single pull request
releases(1h)— Releases for a repository
03Previous Versions1
2026.04.13.1
04Stats
A
100 / 100
Downloads
8
Archive size
8.8 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels