---
name: gitea-work
description: Use when working with Basti's Gitea server via the tea CLI.
version: 0.1.0
author: Hermes
license: MIT
metadata:
  hermes:
    tags: [gitea, tea, git, code-review, issues, pulls]
    related_skills: []
---

# Gitea work via tea

## When to Use

Any task touching Basti's private Gitea (`git.cloud.schroll-it.de`): listing or filing issues, reviewing/creating pull requests, browsing repos, any Schroll-IT org interaction — plus first-time tea setup or login repair.

## Always-on rules

- All Gitea tasks (issues, PRs, repos, comments, reviews) on `git.cloud.schroll-it.de` run through the **tea CLI** (`tea`, on PATH; binary at `~/.local/bin/tea`) — Basti's explicit preference. Use the REST API (`curl -H 'Authorization: token …'`) only for one-off queries tea cannot answer.
- One login exists: **`schroll-it`** (also the default) → user `Hermes` (Bot account, token auth, git credential helper configured). Org is **Schroll-IT**; visible repos: BiteBudget, heim-learning (freezy/pa-server currently not listed by `tea repos`).
- **Default-Repo: Immer `Schroll-IT/BiteBudget`**, sofern Basti kein anderes Repo explizit nennt — keine Repo-Liste abfragen, keine Rückfrage, einfach BiteBudget nehmen.
- git HTTPS remotes authenticate silently via the credential helper tea registered; `~/.git-credentials` also holds the token (`credential.helper store`).

## Procedure

1. **Preflight (first tea call of a session):** `tea login status`. Expect a ✔ for `schroll-it` only. If any other/failed login entry shows up, delete it before doing anything else: `tea login rm <name>`.
2. **Locate work:** `tea repos`, `tea issues` (cross-repo), `tea issues ls --repo <owner>/<name>`, `tea pulls`.
3. **Act:** `tea issues create|comment|close`, `tea pulls create|checkout` — check `tea <cmd> --help` for flags; issues/PRs support `--output json` for parsing.
4. **Verify after any write** by reading back (`tea issues ls` / `tea pulls ls` on the target repo) before reporting success.

## Issue-/PR-Übersichten (Bastis bevorzugtes Ergebnisformat)

- Ein Issue-Überblick ist immer eine **schlanke Tabelle**: Spalte `#` (als Klick-Link), Titel, Labels, ein Einzeiler, worum es geht — kein Fließtext, keine zweite Tabelle daneben. Bot-/Dashboard-Issues (z. B. Renovate-Dashboard) ausdrücklich als solche kennzeichnen, damit die Zahl "echter" offener Arbeit klar bleibt.
- Für solche Antworten **eine** Liste holen, alles drin: `tea issues ls --repo <owner>/<name> --state open --limit 100 --fields index,title,body,labels,author,comments --output json` — `body` direkt mitabfragen und selbst auf einen Einzeiler kürzen, statt eine zweite Runde pro Issue zu brauchen.
- Bevor eine Summe ("insgesamt N", "alle offenen") herausgegeben wird, `--state` und `--limit` explizit gesetzt haben — die Defaults von `tea issues ls` sind `open` bzw. **30 pro Seite** und kürzen lange Listen still.
- **PR zu einem Issue finden:** Issue-Kommentare tragen selten PR-Verweise — stattdessen `tea pulls ls --repo <owner>/<name> --state all --output json`, verdächtige Kandidaten per `tea pulls <n> --output json` auf ihren Body prüfen; die Referenz steht dort im Fließtext (z. B. "Teil 1/2 für Issue #269").

## Pitfalls

- A stale/broken login is silently chosen as **fallback in non-interactive mode**, killing every command with `invalid username, password or token` — run `tea login status` first and remove failures; the error points at auth, not at the command you ran.
- `tea login add` fails with `no password set` when `--user` is combined with `--token` (the `--user` path is basic-auth and wants a password). Pass only `--token --url --name` (+ `--git-credentials`).
- `tea login rm` has **no confirm flag** (`--yes` etc. aborts with a usage error); call it bare: `tea login rm <name>`.
- Write access comes from a Bot account named Hermes: comments/issues are attributed to "Hermes AI Bot", not Basti — say so when attribution matters.
- **Output-Shape prüfen, bevor etwas behauptet wird:** tea meldet unbekannte Subkommandos nicht immer als Fehler — ein falsches Subkommando kann die Liste des Elternkommandos ausgeben, und die Issue-Detail-JSON liefert für `comments` ein leeres Array, während der Zähler nur im Listen-Feld steht. Vor jedem "X hat N Kommentare/Prüfungen": das Kommando per `tea <cmd> --help` bestätigen und die Zahl aus dem Feld nehmen, das sie wirklich führt.

## Setup / recovery

See `references/setup.md` for the tea install recipe (checksum-verified), PATH wiring, and login re-creation.
