The skill doc referenced wrong values: - Remote was 'gitea', should be 'origin' - Repo slug was 'notid/integreat', should be 'notid/ai-game-2' Also added worktree gotcha section and key flags documentation.
152 lines
4.0 KiB
Markdown
152 lines
4.0 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 git remote is `origin` pointing to `git@gitea:notid/ai-game-2.git`. The repo slug is `notid/ai-game-2`.
|
|
|
|
In this project's environment:
|
|
- Gitea login is pre-configured for `gitea.story-basking.ts.net`
|
|
- Repo slug: `notid/ai-game-2`
|
|
- Target branch for PRs: `master`
|
|
- The git remote named `origin` points to this instance
|
|
|
|
## Key Flags
|
|
|
|
All tea subcommands support these flags for repo and auth context:
|
|
- `-r notid/ai-game-2` - Override repo slug (required when auto-discovery fails, e.g. in worktrees)
|
|
- `-R origin` - Discover Gitea login from a specific git remote
|
|
- `-l <username>` - Use a different Gitea login
|
|
|
|
In practice, you usually need just `-r notid/ai-game-2` on the subcommand you're running.
|
|
|
|
## Creating a PR
|
|
|
|
Use `tea pulls create` to open a PR from the current branch to master:
|
|
|
|
```bash
|
|
tea pulls create -r notid/ai-game-2 -b master -t "Title" -d "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/ai-game-2 -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/ai-game-2 # List open PRs
|
|
tea pulls list -r notid/ai-game-2 --state all # All PRs
|
|
tea pulls list -r notid/ai-game-2 --limit 10 -o simple # Limit output, simple format
|
|
```
|
|
|
|
## Opening a PR in Browser
|
|
|
|
```bash
|
|
tea open pr <number> -r notid/ai-game-2
|
|
tea open pr create -r notid/ai-game-2 # Open web UI to create a PR
|
|
```
|
|
|
|
## Checking Out a PR Locally
|
|
|
|
```bash
|
|
tea pulls checkout <number> -r notid/ai-game-2
|
|
```
|
|
|
|
This fetches and checks out the PR branch locally.
|
|
|
|
## Managing PR State
|
|
|
|
**Close a PR:**
|
|
```bash
|
|
tea pulls close <number> -r notid/ai-game-2 --confirm
|
|
```
|
|
|
|
**Reopen a closed PR:**
|
|
```bash
|
|
tea pulls reopen <number> -r notid/ai-game-2 --confirm
|
|
```
|
|
|
|
**Merge a PR:**
|
|
```bash
|
|
tea pulls merge <number> -r notid/ai-game-2 --confirm
|
|
```
|
|
|
|
**Edit a PR (title, description, etc.):**
|
|
```bash
|
|
tea pulls edit <number> -r notid/ai-game-2 -t "New title" -d "New body"
|
|
```
|
|
|
|
## Full PR Creation Workflow
|
|
|
|
1. Commit all changes on your branch:
|
|
```bash
|
|
git add . && git commit -m "describe the change"
|
|
```
|
|
|
|
2. Push the branch to origin:
|
|
```bash
|
|
git push origin <branch-name>
|
|
```
|
|
|
|
3. Create the PR with tea:
|
|
```bash
|
|
tea pulls create -r notid/ai-game-2 -b master \
|
|
-t "feat: description of change" \
|
|
-d "Detailed PR body here"
|
|
```
|
|
|
|
4. Open the PR in browser to verify:
|
|
```bash
|
|
tea open pr <number> -r notid/ai-game-2
|
|
```
|
|
|
|
## Worktree Gotcha
|
|
|
|
When running from a git worktree, tea may fail to auto-discover the repo. Always pass `-r notid/ai-game-2` explicitly in that case:
|
|
|
|
```bash
|
|
tea pulls list -r notid/ai-game-2 # Works in worktrees
|
|
tea pulls create -r notid/ai-game-2 ... # Works in worktrees
|
|
```
|
|
|
|
## Tips
|
|
|
|
- Always use `-r notid/ai-game-2` to specify the repo explicitly, especially in worktrees
|
|
- 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
|
|
- `tea whoami` verifies your authentication before running PR commands
|