67 lines
1.6 KiB
Markdown
67 lines
1.6 KiB
Markdown
# tea CLI — Gitea CLI Fallback
|
|
|
|
`tea` is a CLI tool for Gitea. Use it as a backup when MCP tools fail or are unavailable.
|
|
|
|
## Prerequisites
|
|
|
|
- `tea` must be installed (`brew install tea` or `go install gitea.com/gitea/tea@latest`)
|
|
- Authenticated via `tea login add` (see `references/auth.md`)
|
|
|
|
## Common Operations
|
|
|
|
### Issues
|
|
|
|
```bash
|
|
# List issues
|
|
tea issues --repo owner/repo
|
|
|
|
# View issue details
|
|
tea issues --repo owner/repo 12
|
|
|
|
# Search issues
|
|
tea issues --repo owner/repo --state open --labels bug
|
|
|
|
# Create issue comment
|
|
tea comment --repo owner/repo 12 "comment body"
|
|
```
|
|
|
|
### API fallback (raw)
|
|
|
|
When a specific `tea` subcommand doesn't exist, use the raw API:
|
|
|
|
```bash
|
|
# GET request
|
|
tea api GET /repos/{owner}/{repo}/issues/{index}
|
|
|
|
# POST request
|
|
tea api POST /repos/{owner}/{repo}/issues/{index}/comments --body '{"body": "text"}'
|
|
|
|
# Wiki pages
|
|
tea api GET /repos/{owner}/{repo}/wiki/pages
|
|
tea api GET /repos/{owner}/{repo}/wiki/page/{pageName}
|
|
tea api POST /repos/{owner}/{repo}/wiki/new --body '{"title":"page","content_base64":"..."}'
|
|
tea api PATCH /repos/{owner}/{repo}/wiki/page/{pageName} --body '{"content_base64":"..."}'
|
|
```
|
|
|
|
### Debugging
|
|
|
|
```bash
|
|
# Check current login
|
|
tea login list
|
|
|
|
# Test connectivity
|
|
tea api GET /version
|
|
|
|
# View repo info
|
|
tea repos --repo owner/repo
|
|
```
|
|
|
|
## When to Use tea vs MCP
|
|
|
|
| Scenario | Preferred |
|
|
|----------|-----------|
|
|
| Normal workflow | MCP tools (`mcp__gitea__*`) |
|
|
| MCP server down / unreachable | `tea` CLI |
|
|
| Investigating errors / debugging | `tea api` for raw responses |
|
|
| Bulk operations / scripting | `tea` CLI in Bash |
|