Gitee operations via OpenAPI and git: repositories, pull requests, issues, comments, and file contents. Use when: (1) inspecting or creating Gitee pull requests, (2) listing or creating repository issues, (3) reading repository files from the Gitee API, (4) working with gitee.com remotes from the terminal. NOT for: GitHub-only workflows, local-only git tasks with no Gitee interaction, or browser-only account setup and SSO flows.
使用 git 进行克隆、获取、分支和推送操作。使用 curl + jq 进行结构化的 Gitee API 调用。
✅ 使用此技能的场景:
❌ 不要使用此技能的场景:
bash
export GITEE_API=https://gitee.com/api/v5
export GITEEACCESSTOKEN=...
常见的 Gitee 远程仓库:
text
https://gitee.com/owner/repo.git
git@gitee.com:owner/repo.git
检查当前仓库:
bash
git remote -v
git remote get-url origin
列出开放的拉取请求:
bash
OWNER=owner
REPO=repo
curl -fsS --get $GITEE_API/repos/$OWNER/$REPO/pulls \
--data-urlencode accesstoken=$GITEEACCESS_TOKEN \
--data-urlencode state=open |
jq .[] | {number, title, state, author: .user.login}
查看单个拉取请求:
bash
PR_NUMBER=12
curl -fsS --get $GITEEAPI/repos/$OWNER/$REPO/pulls/$PRNUMBER \
--data-urlencode accesstoken=$GITEEACCESS_TOKEN
创建拉取请求:
bash
HEAD_BRANCH=feature-branch
BASE_BRANCH=main
TITLE=feat: add gitee support
BODY=Summary of the change
curl -fsS -X POST $GITEE_API/repos/$OWNER/$REPO/pulls \
-H Content-Type: application/json \
-d $(jq -nc \
--arg accesstoken $GITEEACCESS_TOKEN \
--arg title $TITLE \
--arg head $HEAD_BRANCH \
--arg base $BASE_BRANCH \
--arg body $BODY \
{accesstoken: $accesstoken, title: $title, head: $head, base: $base, body: $body}) |
jq {number, title, html_url, state}
列出仓库的议题:
bash
curl -fsS --get $GITEE_API/repos/$OWNER/issues \
--data-urlencode accesstoken=$GITEEACCESS_TOKEN \
--data-urlencode repo=$REPO \
--data-urlencode state=open |
jq .[] | {number, title, state}
创建议题:
bash
TITLE=Bug: unexpected failure
BODY=Steps to reproduce...
curl -fsS -X POST $GITEE_API/repos/$OWNER/issues \
-H Content-Type: application/json \
-d $(jq -nc \
--arg accesstoken $GITEEACCESS_TOKEN \
--arg repo $REPO \
--arg title $TITLE \
--arg body $BODY \
{accesstoken: $accesstoken, repo: $repo, title: $title, body: $body}) |
jq {number, title, state, html_url}
读取文件:
bash
FILE_PATH=README.md
curl -fsS --get $GITEEAPI/repos/$OWNER/$REPO/contents/$FILEPATH \
--data-urlencode accesstoken=$GITEEACCESS_TOKEN
创建或更新文件内容时,使用相同的路径并配合 POST 或 PUT。使用 jq -nc 构建 JSON 请求体,并包含端点所需的提交消息和内容字段。
从 Gitee 克隆:
bash
git clone https://gitee.com/$OWNER/$REPO.git
推送当前分支:
bash
git push origin HEAD
添加专用的 Gitee 远程仓库:
bash
git remote add gitee git@gitee.com:$OWNER/$REPO.git
git push gitee HEAD
开放 PR 标题:
bash
jq -r .[] | #\(.number) \(.title)
议题编号和链接:
bash
jq -r .[] | #\(.number) \(.html_url)
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 gitee-1776096249 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 gitee-1776096249 技能
skillhub install gitee-1776096249
文件大小: 2.55 KB | 发布时间: 2026-4-15 12:54