---
name: gitea-tea
description: "Interact with a Gitea server using the tea CLI client"
version: 1.0.0
author: Hermes Agent
license: MIT
dependencies: []
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [gitea, tea, cli, git, issue, pr, release]
    related_skills: []
---
# Gitea-Tea Skill

This skill provides a quick reference for using the `tea` CLI to interact with a Gitea server.

## Prerequisites

- `tea` installed (>=0.14). Install via:
  ```bash
  curl -L -o tea https://dl.gitea.com/tea/0.14.2/tea-linux-amd64
  chmod +x tea
  mv tea ~/.local/bin/  # or any directory in $PATH
  export PATH="$HOME/.local/bin:$PATH"
  ```
- A Gitea Personal Access Token (PAT) with appropriate scopes (repo, issues, etc.).

## Authentication

Add a login profile (once):

```bash
tea login add --name <profile-name> --url https://<gitea-host> --token <your-pat>
```

Example:
```bash
tea login add --name schroll --url https://git.cloud.schroll-it.de --token 248626ed18c608abb2d15785200554b2db79dfc2
```

Verify:
```bash
tea whoami
```

## Common Operations

### List repositories (owner/org)
```bash
tea repo list --owner <org-or-user>
```

### Create an issue
```bash
tea issue create --repo <owner>/<repo> --title "Issue title" \
    --description "Issue description" \
    --add-labels <label1>,<label2>   # optional, existing labels only
```

### Add a comment to an issue/PR
```bash
tea comments add --repo <owner>/<repo> <issue-number> "Your comment text"
```

### Edit an issue (e.g., add labels)
```bash
tea issue edit --repo <owner>/<repo> <issue-number> \
    --add-labels <label1>,<label2>   # use existing labels
```

### Close an issue
```bash
tea issue close --repo <owner>/<repo> <issue-number>
```

### List issues (filterable)
```bash
tea issue list --repo <owner>/<repo> --state open --label bug
```


### Retrieve PR details and diff
```bash
# Get PR details as JSON (includes URL, diffUrl, etc.)
tea pr <PR_NUMBER> --repo <owner>/<repo> --output json

# If you just need a summary, you can request specific fields:
tea pr <PR_NUMBER> --repo <owner>/<repo> --fields "index,title,state,author,updated,labels,diffUrl"

# The `diffUrl` field contains the raw patch/diff URL; you can fetch it with curl or your browser:
curl -L <DIFF_URL>
```

## Notes & Best Practices

- **Labels**: You may only use labels that already exist in the repository. To see available labels:
  ```bash
  tea label list --repo <owner>/<repo>
  ```
- **Non-interactive mode**: When scripting, tea may fall back to a saved login profile; ensure you have added a login with `tea login add`.
- **Error handling**: If you see `remote repository required`, double‑check the `--repo` argument format (`owner/repo`).
- **Security**: Never expose your PAT in logs or shared scripts; consider using `tea login helper setup` for Git credential storage if you need to push/pull over HTTPS.

## Example Session (from this conversation)

```bash
# Login
tea login add --name schroll --url https://git.cloud.schroll-it.de --token 248626ed18c608abb2d15785200554b2db79dfc2

# Create issue
tea issue create --repo Schroll-IT/BiteBudget --title "test Issue von Hermes"

# Add labels (existing ones: bug, testing, automerge)
tea issue edit --repo Schroll-IT/BiteBudget 241 --add-labels bug,testing,automerge

# Add comment
tea comments add --repo Schroll-IT/BiteBudget 241 "Automatischer Kommentar von Hermes: Labels gesetzt und Issue geschlossen."

# Close issue
tea issue close --repo Schroll-IT/BiteBudget 241
```

---

*Tip:* Keep this skill updated if new tea commands or Gitea API changes appear.