# Git Host Patterns CLI command patterns for each supported git host. The installer uses these to adapt PR/MR skills for the user's hosting platform. ## GitHub (`gh` CLI) GitHub CLI requires no special flags for most operations. It infers the repo from the git remote. ### Pull Requests ```bash # List open PRs gh pr list --state open # Create a PR gh pr create --title "feat(scope): short description" --body "PR body here" --base main --head branch-name # View a PR gh pr view 123 # View PR with comments gh pr view 123 --comments # Comment on a PR gh pr comment 123 --body "Comment body here" # Approve a PR gh pr review 123 --approve # Request changes gh pr review 123 --request-changes --body "Reason here" # Merge a PR gh pr merge 123 --squash --delete-branch # Check PR status (CI checks) gh pr checks 123 ``` ### Issues ```bash # List open issues gh issue list --state open # Create an issue gh issue create --title "Bug: description" --body "Details here" # View an issue gh issue view 42 # Comment on an issue gh issue comment 42 --body "Comment here" # Close an issue gh issue close 42 ``` ### CLAUDE.md Pattern ```markdown ### Pull requests Use the `gh` CLI for all GitHub operations. - Create PR: `gh pr create --title "..." --body "..." --base main --head branch` - View PR: `gh pr view N` - Comment: `gh pr comment N --body "..."` - Approve: `gh pr review N --approve` ``` --- ## Gitea (`tea` CLI) Gitea CLI **requires explicit flags** on every command to avoid interactive TTY prompts (which crash in Claude Code). **Required flags on every command:** - `--login ` — The configured login name - `--repo ` — Full repository path - `--output simple` — Machine-readable output (no table borders) ### Pull Requests ```bash # List open PRs tea pr list --login schweitz --repo owner/repo --state open --output simple # Create a PR tea pr create --login schweitz --repo owner/repo \ --title "feat(scope): short description" \ --description "PR body here" \ --base main --head branch-name # View a PR (with comments) tea pr --login schweitz --repo owner/repo --comments -o simple 123 # Comment on a PR (or issue) tea comment --login schweitz --repo owner/repo 123 "Comment body here" # Approve a PR tea pr approve --login schweitz --repo owner/repo 123 ``` ### Issues ```bash # List open issues tea issue list --login schweitz --repo owner/repo --state open --output simple # Create an issue tea issue create --login schweitz --repo owner/repo \ --title "Bug: description" --description "Details here" # View an issue tea issue --login schweitz --repo owner/repo -o simple 42 # Comment on an issue tea comment --login schweitz --repo owner/repo 42 "Comment here" ``` ### Known Limitations - `tea pr reject` does not work on your own PRs — use `tea comment` instead - Always use `--output simple` to avoid TTY formatting crashes - Never omit `--login` or `--repo` — they trigger interactive prompts ### CLAUDE.md Pattern ```markdown ### Pull requests **Use `tea` (Gitea CLI), not `gh` (GitHub CLI).** The remote is Gitea at `{host}`. Always provide all required flags for non-interactive execution: - List PRs: `tea pr list --login {login} --repo {owner/repo} --state open --output simple` - Create PR: `tea pr create --login {login} --repo {owner/repo} --title "..." --description "..." --base main --head branch` - Comment: `tea comment --login {login} --repo {owner/repo} N "body"` - Approve: `tea pr approve --login {login} --repo {owner/repo} N` Key rules: - **All flags must be explicit** — omitting `--login` or `--repo` triggers interactive prompts that crash in Claude Code - **Use `--output simple`** for machine-readable output ``` --- ## GitLab (`glab` CLI) GitLab CLI uses "merge requests" (MR) instead of "pull requests" (PR). It infers the repo from the git remote like GitHub. ### Merge Requests ```bash # List open MRs glab mr list --state opened # Create an MR glab mr create --title "feat(scope): short description" \ --description "MR body here" \ --target-branch main --source-branch branch-name # View an MR glab mr view 123 # Comment on an MR glab mr note 123 --message "Comment body here" # Approve an MR glab mr approve 123 # Merge an MR glab mr merge 123 --squash --remove-source-branch # Check MR pipeline status glab mr view 123 --web ``` ### Issues ```bash # List open issues glab issue list --state opened # Create an issue glab issue create --title "Bug: description" --description "Details here" # View an issue glab issue view 42 # Comment on an issue glab issue note 42 --message "Comment here" # Close an issue glab issue close 42 ``` ### CLAUDE.md Pattern ```markdown ### Merge requests Use the `glab` CLI for all GitLab operations. - Create MR: `glab mr create --title "..." --description "..." --target-branch main --source-branch branch` - View MR: `glab mr view N` - Comment: `glab mr note N --message "..."` - Approve: `glab mr approve N` Note: GitLab uses "merge requests" (MR), not "pull requests" (PR). ``` --- ## Detection Logic The installer detects the git host from the remote URL: ```bash git remote -v ``` | Pattern | Host | CLI | |---------|------|-----| | `github.com` | GitHub | `gh` | | `gitea`, `git.*.internal`, `gogs` | Gitea | `tea` | | `gitlab.com`, `gitlab.*` | GitLab | `glab` | | Other | Ask user | User chooses | For self-hosted instances, the installer asks the user to confirm the host type.