- Official Gitea CLI (tea) for issues, PRs, releases - Includes reference docs: authentication, commands, workflows - Useful for scripting and CI/CD integration - Updated SKILLS-INDEX.md Chronicler #73
1.9 KiB
1.9 KiB
Tea CLI Authentication
Token Creation
- Open Gitea web UI
- Go to Settings → Applications
- Under "Generate New Token", enter a name
- Select scopes (or leave empty for full access)
- Click Generate Token
- Copy the token immediately (shown only once)
Adding a Login
# Interactive
tea login add
# Non-interactive
tea login add \
--name myserver \
--url https://gitea.example.com \
--token ghp_xxxxxxxxxxxx
# With SSH key authentication
tea login add \
--name myserver \
--url https://gitea.example.com \
--ssh-key ~/.ssh/id_ed25519
Managing Logins
tea login list # List all logins
tea login default myserver # Set default
tea login edit myserver # Modify login
tea login delete myserver # Remove login
Environment Variables
export GITEA_SERVER_URL=https://gitea.example.com
export GITEA_SERVER_TOKEN=your_token
# Or per-command
GITEA_SERVER_TOKEN=xxx tea issues
Multiple Instances
# Add multiple servers
tea login add --name work --url https://git.work.com --token xxx
tea login add --name personal --url https://gitea.io --token yyy
# Switch between them
tea issues --login work
tea pr --login personal
# Set default
tea login default work
OAuth Flow
# Browser-based OAuth
tea login add --name myserver --url https://gitea.example.com
# Refresh expired OAuth token
tea login oauth-refresh myserver
CI/CD Usage
# GitHub Actions example
- name: Create PR
env:
GITEA_SERVER_URL: ${{ secrets.GITEA_URL }}
GITEA_SERVER_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: tea pr create --head ${{ github.ref_name }} --base main
Troubleshooting
| Issue | Solution |
|---|---|
| "401 Unauthorized" | Token expired or invalid - regenerate |
| "no login" | Run tea login add first |
| Wrong server | Check tea login list, use --login name |
| SSH auth fails | Ensure key is added to Gitea account |