mitai-jinkendo/scripts/gitea/README.md
Lars 3d498d03c1
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s
feat: Enhance dashboard widget configuration and introduce new widgets
- Updated the dashboard layout schema to include new widgets: DashboardGreeting, QuickWeightToday, BodyStatStrip, StatusPills, ProfileGoalsProgress, TrendKcalWeight, NutritionActivitySummary, RecoverySleepRest, and TrainingTypeDistribution.
- Improved widget configuration validation to support new features, including chart days for trend and distribution widgets.
- Refactored the default lab layout to align with the updated widget catalog and ensure proper default activation.
- Bumped app_dashboard version to 1.6.0 to reflect the addition of new widgets and configuration enhancements.
2026-04-07 14:19:45 +02:00

87 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Gitea API lokales CLI
Dient dazu, **Issues** auf deiner Gitea-Instanz zu lesen und anzulegen mit den in **`.env`** gesetzten Variablen (nicht committen).
## Umgebungsvariablen (Root `.env`)
| Variable | Beispiel |
|----------|----------|
| `GITEA_BASE_URL` | `http://192.168.2.144:3000` |
| `GITEA_TOKEN` | Personal Access Token (nur Scope **repo** + **issue** nötig) |
| `GITEA_OWNER` | `Lars` |
| `GITEA_REPO` | `mitai-jinkendo` |
## Voraussetzung
Python 3.10+ (nur Standardbibliothek).
## MCP vs. CLI (wann was)
| Aufgabe | Empfehlung |
|--------|------------|
| Issues listen, ein Issue lesen, kurzer Kommentar, schließen/öffnen | **MCP** (`gitea_*` in Cursor), weniger Kontext im Chat |
| **Issue-Beschreibung oder Titel ändern** (PATCH) | Kurz im Chat: **MCP** `gitea_patch_issue`. Groß / aus Datei / Automation: **CLI** `issues edit --body-file` |
| Neues Issue mit langem Markdown aus Vorlage | **CLI** `issues create --body-file` |
| Remote-Datei aus Gitea lesen (nicht im Workspace) | **MCP** `gitea_get_repo_file` oder CLI `repo file` |
Beides spricht dieselbe REST-API (`gitea_lib`); Token und `GITEA_*` wie oben.
## Aufruf (im Repo-Root)
```powershell
# Issues auflisten (offen)
python scripts/gitea/gitea_api.py issues list
# Issues mit State
python scripts/gitea/gitea_api.py issues list --state all
# Ein Issue lesen
python scripts/gitea/gitea_api.py issues get 42
# Issue anlegen (Titel + Body aus Datei oder direkt)
python scripts/gitea/gitea_api.py issues create --title "Fix: …" --body "…"
python scripts/gitea/gitea_api.py issues create --title "Fix: …" --body-file path/to/body.md
# Kommentar
python scripts/gitea/gitea_api.py issues comment 42 --body "…"
python scripts/gitea/gitea_api.py issues comment 42 --body-file path/to/comment.md
# Beschreibung und/oder Titel ändern (PATCH)
python scripts/gitea/gitea_api.py issues edit 42 --title "Neuer Titel"
python scripts/gitea/gitea_api.py issues edit 42 --body "Neuer **Markdown**-Body"
python scripts/gitea/gitea_api.py issues edit 42 --body-file path/to/body.md
# Schließen / wieder öffnen
python scripts/gitea/gitea_api.py issues close 42
python scripts/gitea/gitea_api.py issues reopen 42
# Alle Issues (alle Seiten, Vorsicht bei großen Repos)
python scripts/gitea/gitea_api.py issues list --all-pages --state open
# Markdown-Datei (z. B. Audit-Template) als Issue-Body
python scripts/gitea/gitea_api.py issues create --title "…" --body-file .claude/docs/audit/.../gitea/TEMPLATE_P0-....md
```
## Repository-Inhalt (read-only)
```powershell
# Datei über Gitea-API (bei Dateien: Text-Inhalt; bei Verzeichnissen: JSON-Listing)
python scripts/gitea/gitea_api.py repo file README.md
python scripts/gitea/gitea_api.py repo file backend/main.py --ref develop
# Clone/Push: normales `git remote` Token nicht dauerhaft in der Remote-URL; SSH oder Credential Helper.
```
## Sicherheit
- **Niemals** `GITEA_TOKEN` ins Git oder in Issues/Pastebins.
- Token, das in Chat oder Logs gelandet ist, in Gitea **widerrufen** und **neu erzeugen**.
- Cursor-Agenten können das CLI über das Terminal nutzen, wenn `.env` gesetzt und Netzwerk zu `GITEA_BASE_URL` erreichbar ist.
## MCP (Tools direkt im Agent)
Siehe [`MCP_SETUP.md`](./MCP_SETUP.md) und [`../.cursor/mcp.json.example`](../../.cursor/mcp.json.example).
Nach dem Hinzufügen neuer MCP-Tools Cursor einmal **neu starten**, damit die Tool-Liste aktualisiert wird.