Compare commits

...

2 Commits

Author SHA1 Message Date
be2f830b19 fix auth issue 2026-01-08 14:32:09 -05:00
76adec16b6 update skills dir 2026-01-08 02:23:40 -05:00
4 changed files with 118 additions and 48 deletions

View File

@ -28,7 +28,14 @@ The `tea` command-line tool is Gitea's official CLI for interacting with Gitea i
### Context Detection ### Context Detection
Tea automatically detects repository context from the current working directory. It reads `.git/config` to determine the Gitea remote and repository. **CRITICAL**: Tea REQUIRES being run from within a git repository directory that has a Gitea remote configured. It reads `.git/config` to determine the Gitea remote and repository.
**Before running ANY tea command, you MUST:**
1. Navigate to a repository directory: `cd /path/to/repo`
2. Verify a Gitea remote exists: `git remote -v` (should show git.ajet.fyi or similar)
3. Confirm you're authenticated: `tea whoami`
Most tea commands will FAIL if these requirements aren't met. The `--repo owner/repo` flag exists but is unreliable for many operations.
### Authentication ### Authentication
@ -64,27 +71,38 @@ tea releases create --tag v1.0.0 -t "v1.0.0" -n "Release notes"
## Important Notes for Claude Code ## Important Notes for Claude Code
### Always Check Authentication First ### Critical Pre-requisites (CHECK THESE FIRST!)
Before running `tea` commands, verify the user is logged in: **BEFORE suggesting or running ANY `tea` command, you MUST verify:**
1. **Repository Context**: User is in a git repository directory with a Gitea remote
```bash
pwd # Verify current directory
ls .git # Confirm it's a git repo
git remote -v # Must show a Gitea remote (git.ajet.fyi, etc.)
```
2. **Authentication**: User is logged in to tea
```bash
tea whoami
```
**If not in a repository:** Guide the user to navigate to their repository first:
```bash ```bash
tea whoami cd /path/to/repo
``` ```
If not authenticated, guide the user to run: **If no Gitea remote exists:** Tea will not work. User must add a Gitea remote:
```bash
git remote add origin https://git.ajet.fyi/owner/repo.git
```
**If not authenticated:** Guide the user to login:
```bash ```bash
tea login add --url https://git.ajet.fyi tea login add --url https://git.ajet.fyi
``` ```
### Repository Context **IMPORTANT**: The `--repo owner/repo` flag is unreliable and should NOT be used as a workaround. Always ensure proper repository context first.
Tea works best when run from within a git repository directory. If tea commands fail with "no repository found", ensure:
1. You're in a git repository directory
2. The repository has a Gitea remote configured
3. Or use `--repo owner/repo` flag to specify repository explicitly
### Output Formats ### Output Formats
@ -209,11 +227,12 @@ When adding new examples or workflows:
## Common Pitfalls ## Common Pitfalls
- **Not in repo directory**: Many tea commands require repository context - **Not in repo directory**: This is the #1 cause of tea command failures. Tea REQUIRES being in a git repository directory with a Gitea remote. Always verify with `pwd`, `ls .git`, and `git remote -v` before running tea commands.
- **Missing authentication**: Always check `tea whoami` first - **Missing Gitea remote**: Tea only works with Gitea remotes (e.g., git.ajet.fyi). It will NOT work with GitHub, GitLab, or other Git hosting services.
- **Wrong remote**: Tea looks for Gitea remotes, not GitHub/GitLab - **Using `--repo` flag as workaround**: The `--repo owner/repo` flag is unreliable. Don't use it as a substitute for proper repository context.
- **Insufficient token permissions**: Token needs appropriate scopes - **Missing authentication**: Always check `tea whoami` before running commands
- **Branch not pushed**: Can't create PR for unpushed branches - **Insufficient token permissions**: Token needs appropriate scopes for the operations you're performing
- **Branch not pushed**: Can't create PR for unpushed branches - ensure `git push` succeeds first
## Testing ## Testing

View File

@ -63,13 +63,16 @@ This repository provides a comprehensive Claude Code skill for the `tea` CLI.
### Installing the Skill ### Installing the Skill
The skill is located in the `skills/` directory. To use it with Claude Code: The skill is located in the `skills/tea/` directory. To use it with Claude Code, symlink it to your Claude Code skills directory:
1. This repository should be in your Claude Code skills directory, or ```bash
2. Symlink the skills directory to `~/.claude/skills/tea`: ln -s /path/to/gong-fu-cha/skills/tea ~/.claude/skills/tea
```bash ```
ln -s /path/to/gong-fu-cha/skills ~/.claude/skills/tea
``` For example:
```bash
ln -s ~/repos/ajet-industries/gong-fu-cha/skills/tea ~/.claude/skills/tea
```
### Using the Skill ### Using the Skill
@ -130,16 +133,19 @@ tea releases create --tag v1.0.0 -t "Version 1.0.0" -n "Release notes"
- **Tea Manual**: Run `tea man` for comprehensive documentation - **Tea Manual**: Run `tea man` for comprehensive documentation
- **Command Help**: Run `tea <command> --help` for command-specific help - **Command Help**: Run `tea <command> --help` for command-specific help
- **Skill Documentation**: See `skills/SKILL.md` for Claude Code integration details - **Skill Documentation**: See `skills/tea/SKILL.md` for Claude Code integration details
- **Examples**: See `skills/tea/examples.md` for usage examples
## Repository Structure ## Repository Structure
``` ```
gong-fu-cha/ gong-fu-cha/
├── skills/ ├── skills/
│ └── SKILL.md # Claude Code skill definition │ └── tea/
├── README.md # This file │ ├── SKILL.md # Claude Code skill definition
└── CLAUDE.md # Instructions for Claude Code │ └── examples.md # Usage examples
├── README.md # This file
└── CLAUDE.md # Instructions for Claude Code
``` ```
## Why "Gong Fu Cha"? ## Why "Gong Fu Cha"?

View File

@ -20,6 +20,16 @@ Use this skill when you need to:
The `tea` CLI tool interacts directly with Gitea instances via their API. It automatically detects repository context from your current directory and uses stored login credentials. The `tea` CLI tool interacts directly with Gitea instances via their API. It automatically detects repository context from your current directory and uses stored login credentials.
## ⚠️ Critical Requirements
**BEFORE running any `tea` commands, you MUST:**
1. **Be inside a git repository directory** - Navigate to a repository with `cd /path/to/repo`
2. **Have a Gitea remote configured** - The repository must have a remote pointing to your Gitea instance (e.g., git.ajet.fyi)
3. **Be authenticated** - Run `tea whoami` to verify you're logged in
Most `tea` commands will FAIL if you're not in a repository directory with a Gitea remote. The `--repo` flag exists but is unreliable for many operations.
## Setup ## Setup
### Check if logged in ### Check if logged in
@ -218,13 +228,24 @@ tea open 42 # Open issue/PR #42
### Repository Context ### Repository Context
Tea automatically detects the repository from your current directory. Override with: **REQUIREMENT**: Tea requires you to be in a git repository directory with a Gitea remote configured. It reads `.git/config` to determine the repository context.
**Verify your repository has a Gitea remote:**
```bash ```bash
tea pr ls --repo owner/repo git remote -v
tea issues create --repo owner/repo -t "Title" # Should show a remote pointing to your Gitea instance (e.g., git.ajet.fyi)
``` ```
**If no Gitea remote exists, add one:**
```bash
git remote add origin https://git.ajet.fyi/owner/repo.git
```
**The `--repo` flag is unreliable** - While tea provides a `--repo owner/repo` flag, many commands don't work correctly with it. Always run tea from within the repository directory.
**Troubleshooting invalid TTY errors:**
If you encounter errors like `huh: could not open a new TTY: open /dev/tty: no such device or address`, this is a symptom of running `tea` from an invalid working directory (not a git repository with a Gitea remote). Check `~/repos` for git directories with valid Gitea remotes and navigate to one before running tea commands.
### Login Selection ### Login Selection
Use a specific Gitea login: Use a specific Gitea login:
@ -282,37 +303,60 @@ tea pr ls --limit 50
## Important Notes ## Important Notes
- **Repository context**: Tea works best when run from within a git repository directory - **Repository context REQUIRED**: You MUST run tea from within a git repository directory that has a Gitea remote configured. Commands will fail otherwise.
- **Multiple logins**: You can configure multiple Gitea instances - **Verify before running**: Always check `git remote -v` to ensure you have a Gitea remote before running tea commands
- **Navigate to repo first**: Use `cd /path/to/repo` to change to your repository directory before running tea
- **Multiple logins**: You can configure multiple Gitea instances with `tea login add`
- **Default login**: Set a default login with `tea login default` - **Default login**: Set a default login with `tea login default`
- **Token permissions**: Ensure your access token has appropriate scopes - **Token permissions**: Ensure your access token has appropriate scopes for the operations you need
- **Help available**: Run `tea <command> --help` for detailed options - **Help available**: Run `tea <command> --help` for detailed options
- **Manual pages**: Use `tea man` for comprehensive documentation - **Manual pages**: Use `tea man` for comprehensive documentation
## Typical Workflows ## Typical Workflows
### Pre-flight Checklist
**BEFORE running any tea workflow, verify:**
```bash
# 1. Check you're in a git repository
pwd # Should show your repo directory
ls .git # Should exist
# 2. Verify Gitea remote is configured
git remote -v # Should show git.ajet.fyi or your Gitea instance
# 3. Check authentication
tea whoami # Should show your username
```
If any of these fail, fix them before proceeding with tea commands.
### Creating a PR from a feature branch ### Creating a PR from a feature branch
1. Make changes and commit 1. **Verify you're in the correct repository directory**
2. Push to remote 2. Make changes and commit
3. Create PR: 3. Push to remote
4. Create PR:
```bash ```bash
tea pr create -t "Feature: New capability" -d "Description of changes" tea pr create -t "Feature: New capability" -d "Description of changes"
``` ```
4. Wait for review or review yourself 5. Wait for review or review yourself
### Reviewing and merging a PR ### Reviewing and merging a PR
1. List PRs: `tea pr ls` 1. **Navigate to repository directory**: `cd /path/to/repo`
2. Checkout locally: `tea pr checkout 42` 2. List PRs: `tea pr ls`
3. Test the changes 3. Checkout locally: `tea pr checkout 42`
4. Approve: `tea pr approve 42` 4. Test the changes
5. Merge: `tea pr merge 42 --style squash` 5. Approve: `tea pr approve 42`
6. Merge: `tea pr merge 42 --style squash`
### Creating a release ### Creating a release
1. Ensure you're on the right branch/commit 1. **Navigate to repository directory**: `cd /path/to/repo`
2. Create release: 2. Ensure you're on the right branch/commit
3. Create release:
```bash ```bash
tea releases create --tag v1.0.0 --title "Version 1.0.0" \ tea releases create --tag v1.0.0 --title "Version 1.0.0" \
--note "Release notes" --asset ./binary --note "Release notes" --asset ./binary
@ -320,10 +364,11 @@ tea pr ls --limit 50
### Managing issues ### Managing issues
1. List open issues: `tea issues ls --state open` 1. **Navigate to repository directory**: `cd /path/to/repo`
2. View specific issue: `tea issues 42` 2. List open issues: `tea issues ls --state open`
3. Add comment: `tea comment 42 "Working on this"` 3. View specific issue: `tea issues 42`
4. Close when done: `tea issues close 42` 4. Add comment: `tea comment 42 "Working on this"`
5. Close when done: `tea issues close 42`
## Getting Help ## Getting Help