Files
poimen-memory/knowledge/tea-cli.md
T
rock f52bc7b88a
Build and Push / Test (push) Failing after 7s
Build and Push / Build and push image (push) Skipped
feat: add curl, tea CLI, verify-done knowledge for API verification
3 new knowledge files, 31 chunks ingested:
- curl-api-testing.md: API testing patterns, auth, error testing, k8s testing
- tea-cli.md: Gitea CLI for issues, PRs, CI runs, releases
- verify-done.md: definition of done checklist, verification workflow
2026-08-29 22:27:56 -07:00

146 lines
3.2 KiB
Markdown

# tea CLI — Gitea/Forgejo Command Line
## Setup
```bash
# Login to Forgejo instance
tea login add --name riotpiao \
--url https://git.riotpiao.com \
--token <your-token>
# Verify
tea whoami
```
## Repository Operations
```bash
# List repos
tea repos ls
# Clone
tea clone rock/poimen-memory
# Open in browser
tea open
```
## Issues & Tickets
```bash
# List issues
tea issues ls --repo rock/poimen-memory
tea issues ls --state open
tea issues ls --labels bug
# Create issue
tea issues create --title "Fix port conflict" --body "Port 8080 is in use"
# Close issue
tea issues close 42
# Comment on issue
tea comments create 42 --body "Fixed in commit abc123"
# Assign
tea issues edit 42 --assignees rock
```
## Pull Requests
```bash
# List PRs
tea pr ls --repo rock/poimen-memory
tea pr ls --state open
# Create PR from current branch
tea pr create --title "feat: add learn command" --base main
# Checkout a PR locally
tea pr checkout 15
# Merge PR
tea pr merge 15 --style squash
# Review PR
tea pr review 15 --approve
tea pr review 15 --request-changes --body "Fix the unwrap()"
```
## CI/CD — Actions & Workflows
```bash
# List workflow runs
tea actions runs list --repo rock/poimen-memory
tea actions runs list --repo rock/poimen-memory --limit 5
# View specific run
tea actions runs view <run-id> --repo rock/poimen-memory
# List workflows
tea actions workflows list --repo rock/poimen-memory
# Secrets management
tea actions secrets list --repo rock/poimen-memory
tea actions secrets create --repo rock/poimen-memory --name MY_SECRET --value "secret123"
# Variables
tea actions variables list --repo rock/poimen-memory
```
## Releases
```bash
# List releases
tea releases ls --repo rock/poimen-memory
# Create release
tea releases create --repo rock/poimen-memory \
--tag v1.0.0 \
--title "v1.0.0 — Production Release" \
--note "First production release"
```
## Wiki
```bash
# List wiki pages
tea wiki ls --repo rock/poimen-memory
# Create wiki page
tea wiki create --repo rock/poimen-memory \
--title "Setup Guide" \
--content "# Setup\n..."
```
## API Direct Access
```bash
# Raw API call (authenticated)
tea api /repos/rock/poimen-memory
tea api /repos/rock/poimen-memory/issues?state=open
# POST via API
tea api --method POST /repos/rock/poimen-memory/issues \
--body '{"title":"test","body":"test issue"}'
```
## Ticket Verification Workflow
After completing a task, verify the ticket is done:
```bash
# 1. Check CI passed
tea actions runs list --repo rock/poimen-memory --limit 1
# Should show: ✓ completed / success
# 2. Check issue is closed or PR merged
tea issues ls --repo rock/poimen-memory --state closed --limit 5
# 3. Verify the API endpoint works (curl the actual service)
curl -s http://localhost:8080/health | jq .status
# Should return: "ok"
# 4. Tag release if milestone complete
tea releases create --tag v1.x.x --title "Milestone X complete"
```
## Useful Flags
- `--repo owner/name` — specify repo (or use current git context)
- `--output simple` — machine-readable output
- `--output yaml` — YAML format
- `--output json` — JSON format for piping to jq
- `--limit N` — limit results
- `--state open|closed|all` — filter by state
- `--fields name,status` — select columns