| name | gitea-tea |
| description | Manage Gitea via CLI. Use when user mentions "tea", "gitea cli", or needs terminal-based Gitea operations. |
| version | 2.0.0 |
Gitea CLI (tea)
Overview
Official command-line interface for Gitea. Manage issues, PRs, releases, workflows, webhooks, and repos from terminal.
Version: tea 0.12.0+ with Gitea API v0.23.2
Quick Reference
| Category | Commands |
|---|
| Issues | tea issues, tea i |
| Pull Requests | tea pulls, tea pr |
| Releases | tea releases, tea r |
| Labels | tea labels |
| Milestones | tea milestones, tea ms |
| Gitea Actions | tea actions ⭐ |
| Webhooks | tea webhooks, tea hooks ⭐ |
| Repositories | tea repos |
| Branches | tea branches, tea b |
| Organizations | tea orgs, tea org |
| Time Tracking | tea times, tea t |
| Notifications | tea notifications, tea n |
| Comments | tea comment, tea c |
| API | tea api |
| Admin | tea admin, tea a |
Instructions
- Verify authentication: Run
tea whoami to confirm login
- Check context: Run in git repo for auto-detection, or use
--repo owner/repo
- Use non-interactive mode: Always use
--output flag and provide all arguments
- Choose operation: See command reference sections below
Installation
brew install tea
curl -sL https://dl.gitea.io/tea/main/tea-main-linux-amd64 -o tea
chmod +x tea && sudo mv tea /usr/local/bin/
scoop install tea
go install code.gitea.io/tea@latest
Authentication
tea login add
tea login list
tea login default gitea.example.com
tea login delete gitea.example.com
tea whoami
Issues
List Issues
tea issues list
tea issues list --state all
tea issues list --milestone "v1.0.0"
tea issues list --assignee username --labels bug,critical
tea issues list --fields index,title,state,author,labels,created
tea issues list --keyword "authentication"
tea issues list --from "2024-01-01" --until "2024-12-31"
tea issues list --repo owner/repo --login gitea.com
tea issues list --output json
tea issues list --output yaml
View Issue
tea issues 42
tea issues 42 --comments=false
tea open 42
Create Issue
tea issues create
tea issues create \
--title "Fix authentication bug" \
--body "Users cannot login with special characters" \
--labels bug,security \
--assignee developer1 \
--milestone "v1.2.0"
tea issues create \
--title "Feature request" \
--body "$(cat feature-request.md)"
Modify Issues
tea issues close 42
tea issues reopen 42
tea issues edit 42 \
--title "Updated title" \
--assignee newdev \
--add-labels "enhancement"
Pull Requests
List PRs
tea pulls list
tea pulls list --state closed
tea pulls list --reviewer username --labels "needs-review"
tea pulls list --fields index,title,state,author,base,head,mergeable
tea pulls list --output json
View PR
tea pulls 15
tea pulls 15 --comments=false
tea open 15
Create PR
tea pulls create
tea pulls create \
--title "Implement user authentication" \
--description "Adds OAuth and JWT support" \
--base main \
--head feature/auth \
--assignee reviewer1,reviewer2 \
--labels "enhancement"
tea pulls create \
--title "Major refactor" \
--description "$(cat pr-description.md)"
Checkout PR
tea pulls checkout 20
tea pulls checkout 20 pr-20-custom-name
tea pulls clean
Review & Merge
tea pulls approve 20 --comment "LGTM!"
tea pulls reject 20 --comment "Please add tests"
tea pulls review 20 \
--state comment \
--comment "Consider refactoring this section"
tea pulls merge 20 --style squash --message "feat: implement auth"
tea pulls merge 20 --style rebase
tea pulls close 20
tea pulls reopen 20
Releases
List Releases
tea releases list
tea releases list --limit 10
tea releases list --repo owner/project
tea releases list --output json
Create Release
tea releases create v1.0.0 \
--title "Version 1.0.0" \
--note "First stable release"
tea releases create v1.2.0 \
--title "Version 1.2.0" \
--note-file CHANGELOG.md
tea releases create v2.0.0-beta \
--title "Beta Release" \
--draft \
--note "Beta for testing"
tea releases create v1.1.0-rc1 \
--title "Release Candidate 1" \
--prerelease \
--asset dist/binary-linux-amd64 \
--asset dist/binary-darwin-amd64
tea releases create v1.3.0 \
--target main \
--title "Version 1.3.0" \
--note "New features"
Manage Release Assets
tea releases assets list v1.0.0
tea releases assets create v1.0.0 --asset dist/binary.exe
tea releases assets delete v1.0.0 binary.exe
Edit/Delete Release
tea releases edit v1.0.0 \
--title "Version 1.0.0 - Updated" \
--note-file NEW-NOTES.md
tea releases edit v2.0.0 --draft=false
tea releases delete v0.9.0
tea releases delete v1.0.0-beta --confirm
Labels
tea labels list
tea labels list --repo owner/project
tea labels list --save
tea labels create bug \
--color "#ff0000" \
--description "Something isn't working"
tea labels create enhancement \
--color "0,255,0" \
--description "New feature"
tea labels update bug --color "#cc0000"
tea labels update old-name --name new-name
tea labels delete bug
Milestones
tea milestones list
tea milestones list --state open
tea milestones list --state closed
tea milestones issues "v1.0.0"
tea milestones issues "v1.0.0" --kind pull
tea milestones issues "v1.0.0" --state all
tea milestones issues add "v1.0.0" 42
tea milestones issues remove "v1.0.0" 42
tea milestones create "v2.0.0" \
--description "Major version release" \
--deadline "2024-12-31"
tea milestones close "v1.0.0"
tea milestones reopen "v1.0.0"
tea milestones delete "v0.9.0"
Repositories
tea repos list
tea repos list --owner myorg
tea repos list --watched
tea repos list --starred
tea repos list --type fork
tea repos list --output yaml
tea repos search "keyword" --login gitea.com
tea repos owner/repo
tea repos create --name myrepo --private --init
tea repos create \
--name myrepo \
--owner myorg \
--description "My project" \
--private \
--init \
--gitignores Go \
--license MIT
tea repos create-from-template \
--template owner/template-repo \
--name new-repo
tea repos fork --repo owner/repo
tea repos fork --repo owner/repo --owner myorg
tea repos migrate \
--name migrated-repo \
--clone-url https://github.com/user/repo.git
tea repos edit owner/repo --description "Updated description"
tea repos delete owner/repo
tea clone owner/repo
tea clone owner/repo ./target-dir
tea clone gitea.com/owner/repo
Branches
tea branches list
tea branches list --output json
tea branches main
tea branches protect main
tea branches unprotect main
Gitea Actions ⭐
Manage CI/CD workflows, secrets, and variables.
Secrets
tea actions secrets list
tea actions secrets list --repo owner/repo
tea actions secrets create SECRET_NAME "secret-value"
tea actions secrets create SECRET_NAME --file secret.txt
echo "secret-value" | tea actions secrets create SECRET_NAME --stdin
tea actions secrets delete SECRET_NAME
Variables
tea actions variables list
tea actions variables set VAR_NAME "variable-value"
tea actions variables set VAR_NAME --file variable.txt
echo "variable-value" | tea actions variables set VAR_NAME --stdin
tea actions variables delete VAR_NAME
Workflow Runs
tea actions runs list
tea actions runs view <run-id>
tea actions runs rerun <run-id>
tea actions runs cancel <run-id>
tea actions runs logs <run-id>
Workflows
tea actions workflows list
tea actions workflows view <workflow-id>
Webhooks ⭐
Manage repository, organization, or global webhooks.
tea webhooks list
tea webhooks list --repo owner/repo
tea webhooks list --org myorg
tea webhooks list --global
tea webhooks create https://example.com/webhook \
--events push,pull_request \
--secret "webhook-secret"
tea webhooks create https://example.com/webhook \
--events push \
--branch-filter "main,develop" \
--active
tea webhooks update <webhook-id> \
--url https://new-url.com/webhook \
--active false
tea webhooks delete <webhook-id>
Time Tracking
tea times list
tea times list --issue 42
tea times list --user username
tea times list --from "2024-01-01" --until "2024-12-31"
tea times list --mine
tea times add 42 "2h"
tea times add 42 "1h30m"
tea times delete 42 --id 123
tea times reset 42
tea times list --total
Notifications
tea notifications list
tea notifications list --mine
tea notifications list --types issue,pull
tea notifications list --states unread,pinned
tea notifications list --fields id,status,title,repository
tea notifications read
tea notifications read 123
tea notifications unread 123
tea notifications pin 123
tea notifications unpin 123
Organizations
tea organizations list
tea organizations myorg
tea organizations create myorg
tea organizations delete myorg
Comments
tea comment 42 "This is my comment"
tea comment 42 "Comment text" --repo owner/repo
API & Advanced Usage ⭐
Make authenticated API requests directly.
Basic Requests
tea api /repos/{owner}/{repo}/issues
tea api '/repos/{owner}/{repo}/issues?state=open&page=1&limit=50'
tea api /repos/{owner}/{repo}/issues \
--method POST \
-f title="API Created Issue" \
-f body="Created via API"
tea api /user \
-H "Accept: application/json"
Typed Fields (-F)
tea api /repos/{owner}/{repo} \
-F private=true
tea api /repos/{owner}/{repo}/issues \
-F milestone=5
tea api /repos/{owner}/{repo}/issues/42 \
-X PATCH \
-F assignee=null
tea api /repos/{owner}/{repo}/issues \
-F labels="[1,2,3]"
tea api /repos/{owner}/{repo}/issues \
-F body=@issue-body.txt
cat issue-body.txt | tea api /repos/{owner}/{repo}/issues \
-F body=@-
Raw JSON Body
tea api /repos/{owner}/{repo}/issues \
--method POST \
--data @issue.json
cat issue.json | tea api /repos/{owner}/{repo}/issues \
--method POST \
--data @-
tea api /repos/{owner}/{repo}/issues \
--method POST \
--data '{"title":"Issue title","body":"Issue body"}'
Output Options
tea api /repos/{owner}/{repo} --output repo.json
tea api /repos/{owner}/{repo} --include
Placeholders
tea api /repos/{owner}/{repo}/issues
Admin (requires admin access)
tea admin users list
tea admin users list --output json
Non-Interactive Mode (AI Agents)
IMPORTANT: When using tea in AI agent environments (no TTY), avoid interactive prompts:
tea issues list --output simple
tea pulls list --output json
tea issues create --title "Bug title" --body "Description here"
tea pulls create --title "PR title" --head feature-branch --base main
tea pulls merge 5 --yes
tea releases delete v0.9.0 --yes
tea login default <login-name>
tea issues list --repo owner/repo
tea issues list --output simple --fields index,title,state
Always prefer explicit flags over interactive prompts.
Common Workflows
Feature Branch → PR
git checkout -b feature/new-feature
git add . && git commit -m "feat: add new feature"
git push -u origin feature/new-feature
tea pulls create --title "Add new feature" --base main --head feature/new-feature
Review & Merge PR
tea pulls checkout 20
tea pulls approve 20 --comment "LGTM!"
tea pulls merge 20 --style squash
Create Release with Assets
git tag v1.0.0
git push origin v1.0.0
tea releases create v1.0.0 \
--title "v1.0.0" \
--note-file CHANGELOG.md \
--asset dist/app-linux \
--asset dist/app-darwin
Setup CI/CD Secrets
tea actions secrets create DOCKER_USERNAME "myuser"
tea actions secrets create DOCKER_PASSWORD "mypass"
tea actions variables set DEPLOY_ENV "production"
Webhook for Notifications
tea webhooks create https://hooks.slack.com/services/YOUR/WEBHOOK/URL \
--events push,pull_request \
--secret "webhook-secret"
Bulk Issue Management
tea issues list --labels bug --output json > bugs.json
for i in {1..5}; do
tea issues create --title "Issue $i" --body "Description for issue $i"
done
Output Formats
All list commands support multiple output formats:
--output simple
--output table
--output csv
--output tsv
--output yaml
--output json
Guidelines
Do
- Use
--output simple or --output json for non-interactive mode
- Provide all required arguments upfront to avoid prompts
- Run
tea whoami to verify authentication before operations
- Use
tea open <number> to quickly view in browser
- Use
--fields to customize output columns
- Use
tea api for advanced operations not covered by commands
Don't
- Use interactive commands in AI agent context (no TTY)
- Forget
--repo owner/repo when outside git repository
- Skip
--yes flag for destructive operations in scripts
- Use
tea login add interactively (configure beforehand)
- Assume default output format in scripts (always specify --output)
Troubleshooting
Authentication Issues
tea whoami
tea login list
tea login default <login-name>
Repo Not Found
tea issues list --repo owner/repo
tea issues list --remote origin
No Output / Empty Results
tea issues list --state all
tea whoami
tea --debug issues list
Environment Variables
export TEA_CONFIG=~/.config/tea
export TEA_DEBUG=1
Further Reading