关于 create-pull
使用 tea CLI 创建 Pull Request 的技能,支持交互式操作或命令行选项,也介绍从 Fork 创建请求、WIP 标题约定,以及结构化查找新建请求。
主要功能
- 01交互式创建 Pull Request
- 02设置请求信息和元数据
- 03从 Fork 创建请求
- 04使用 WIP 标题约定
- 05按分支查找请求
适用场景
- 01从当前分支发起请求
- 02提交来自 Fork 的贡献
- 03获取新建请求的 URL 或编号
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ deevus/ tea-skills --skill create-pull安装后在 Claude Code 中输入/create-pull确认已加载。
详细介绍
创建拉取请求
使用 tea pulls create 创建拉取请求。捆绑的操作仅用于填补 CLI 的功能缺口,并记录在 actions/pull-requests/README.md 下。
解析 actions/... 路径时,请使用相对于此技能目录捆绑的 actions/ 目录。
如果用户指定了登录名、远程端、后端或仓库,请向捆绑的操作传递显式范围标志(--login、--remote 或 --repo)。否则,捆绑的操作会优先从当前活动主机进行发现。
创建
tea pulls create # interactive, current branch -> default branch
tea pulls create --title "Add auth" --description "Implements JWT" \
--head "feature/auth" --base "main" \
--labels "bugfix" --assignees "sh" --milestone "v1.0"
tea pulls create --head "contributor:feature-branch" --base "main" # from fork
WIP PR 约定
当 Forgejo/Gitea 工作流将 WIP 标题视为类似草稿的拉取请求时,使用常规 tea CLI,并在标题前加上 WIP:。
tea pulls create --title "WIP: Feature" --head feature-branch
tea pulls create --title "WIP: Feature" --head feature-branch --base develop
快速模式
# PR from current branch
git push -u origin HEAD
tea pulls create --title "$(git log -1 --format=%s)" --head "$(git branch --show-current)"
重新发现已创建的 PR
tea pulls create 的输出面向人工阅读。如果需要获取已创建 PR 的编号或 URL 用于自动化,请使用结构化分支查找操作,而不要解析命令输出:
actions/pull-requests/find-by-branch.py
actions/pull-requests/find-by-branch.py --head "$(git branch --show-current)"
actions/pull-requests/find-by-branch.py --head "contributor:feature-branch" --base main
该操作会将每个匹配的拉取请求输出为一个 JSON 对象,以 JSONL 格式呈现,适用于 jq 或 Agent 直接解析。
评论
支持 Markdown