128 lines
3.3 KiB
Markdown
128 lines
3.3 KiB
Markdown
---
|
|
name: gitea-tea
|
|
description: Use tea CLI to create, manage, and checkout Gitea pull requests. Use this when opening a PR, managing PRs, or checking out PRs on the gitea remote (gitea.story-basking.ts.net).
|
|
---
|
|
|
|
# Gitea Tea CLI Skill
|
|
|
|
This skill covers using `tea` (Gitea's official CLI) for pull request workflows in this project.
|
|
|
|
## When to Use This Skill
|
|
|
|
Use this skill when you need to:
|
|
- Create a PR from a working branch to master on the gitea remote
|
|
- Open, list, or view PRs
|
|
- Checkout a PR locally for review or iteration
|
|
- Manage PR state (close, reopen, merge)
|
|
|
|
## Project Setup
|
|
|
|
The gitea remote is `gitea.story-basking.ts.net` with repo slug `notid/integreat`. The default push remote is **gitea**, NOT origin and NOT deploy.
|
|
|
|
In this project's environment:
|
|
- Gitea login is pre-configured for `gitea.story-basking.ts.net`
|
|
- Repo slug: `notid/integreat`
|
|
- Target branch for PRs: `master`
|
|
- The git remote named `gitea` points to this instance
|
|
|
|
## Creating a PR
|
|
|
|
Use `tea pulls create` to open a PR from the current branch to master. Always specify `-r notid/integreat -b master`:
|
|
|
|
```bash
|
|
tea pulls create -r notid/integreat -b master --title "Title" --description "Body"
|
|
```
|
|
|
|
Common flags:
|
|
- `-t, --title` - PR title
|
|
- `-d, --description` - PR body/description (use heredoc or file for long descriptions)
|
|
- `-a, --assignees` - Comma-separated usernames to assign
|
|
- `-L, --labels` - Comma-separated labels to apply
|
|
- `-m, --milestone` - Milestone to assign
|
|
|
|
**Writing a multiline description:**
|
|
|
|
```bash
|
|
tea pulls create -r notid/integreat -b master \
|
|
-t "feat: add feature" \
|
|
-d "$(cat <<'EOF'
|
|
## Summary
|
|
- Bullet point one
|
|
- Bullet point two
|
|
EOF
|
|
)"
|
|
```
|
|
|
|
Or write the body to a temp file first and reference it.
|
|
|
|
## Listing PRs
|
|
|
|
```bash
|
|
tea pulls list -r notid/integreat # List open PRs
|
|
tea pulls list -r notid/integreat --state all # All PRs
|
|
tea pulls list -r notid/integreat --limit 10 -o simple # Limit output, simple format
|
|
```
|
|
|
|
## Opening a PR in Browser
|
|
|
|
```bash
|
|
tea open pr <number> -r notid/integreat
|
|
tea open pr create -r notid/integreat # Open web UI to create a PR
|
|
```
|
|
|
|
## Checking Out a PR Locally
|
|
|
|
```bash
|
|
tea pulls checkout <number> -r notid/integreat
|
|
```
|
|
|
|
This fetches and checks out the PR branch locally.
|
|
|
|
## Managing PR State
|
|
|
|
**Close a PR:**
|
|
```bash
|
|
tea pulls close <number> -r notid/integreat --confirm
|
|
```
|
|
|
|
**Reopen a closed PR:**
|
|
```bash
|
|
tea pulls reopen <number> -r notid/integreat --confirm
|
|
```
|
|
|
|
**Merge a PR:**
|
|
```bash
|
|
tea pulls merge <number> -r notid/integreat --confirm
|
|
```
|
|
|
|
**Edit a PR (title, description, etc.):**
|
|
```bash
|
|
tea pulls edit <number> -r notid/integreat --title "New title" --description "New body"
|
|
```
|
|
|
|
## Full PR Creation Workflow
|
|
|
|
1. Ensure the branch is pushed to gitea:
|
|
```bash
|
|
git push gitea <branch-name>
|
|
```
|
|
|
|
2. Create the PR with tea:
|
|
```bash
|
|
tea pulls create -r notid/integreat -b master \
|
|
--title "feat: description of change" \
|
|
--description "Detailed PR body here"
|
|
```
|
|
|
|
3. Open the PR in browser to verify:
|
|
```bash
|
|
tea open pr <number> -r notid/integreat
|
|
```
|
|
|
|
## Tips
|
|
|
|
- Always use `-r notid/integreat` to specify the repo explicitly
|
|
- Use `-b master` to set the target branch (default may differ)
|
|
- The `--confirm` flag is required for destructive actions (close, merge)
|
|
- Use `-o simple`, `-o json`, `-o table`, etc. to control output format
|