Create a PR for the current branch. Use when the user asks to create a pull request, submit PR, or says 'pr'.
canary (development branch, cloud production)main is the release branch — never PR directly to maingit branch --show-current — current branch namegit status --short — uncommitted changesgit rev-parse --abbrev-ref @{u} 2>/dev/null — remote tracking statusgit log --oneline origin/canary..HEAD — unpushed commitsgh pr list --head "$(git branch --show-current)" --json number,title,state,url — existing PRgit diff --stat --stat-count=20 origin/canary..HEAD — change summaryIf current branch is canary (or main) AND there are uncommitted changes:
git diff) to understand the changes<type>/<short-description> (e.g. fix/i18n-cjk-spacing)git checkout -b <branch-name>git add <files> (prefer explicit file paths over git add .)If current branch is canary/main but there are NO uncommitted changes and no unpushed commits, abort — nothing to create a PR for.
git push -u origin $(git branch --show-current)git push origin $(git branch --show-current)gh issue list --search "<keywords>" --state all --limit 10gh pr create --base canary<gitmoji> <type>(<scope>): <description>.github/PULL_REQUEST_TEMPLATE.md), fill checkboxesFixes #123, Closes #123)Fixes LOBE-xxx)gh pr view --web
Use .github/PULL_REQUEST_TEMPLATE.md as the body structure. Key sections: