Gitlab Manager技能使用说明
2026-03-29
新闻来源:网淘吧
围观:25
电脑广告
手机广告
GitLab 管理器
此技能允许通过 API 与 GitLab.com 进行交互。
前提条件
- GITLAB_TOKEN:一个具有
api范围的个人访问令牌必须设置在环境变量中。
使用方法
使用提供的 Node.js 脚本与 GitLab 交互。

脚本位置
scripts/gitlab_api.js
命令
1. 创建仓库
在 GitLab 中创建一个新项目。
./scripts/gitlab_api.js create_repo "<name>" "<description>" "<visibility>"
# Visibility: private (default), public, internal
2. 列出合并请求
列出特定项目的合并请求。
./scripts/gitlab_api.js list_mrs "<project_path>" "[state]"
# Project path: e.g., "jorgermp/my-repo" (will be URL encoded automatically)
# State: opened (default), closed, merged, all
3. 评论合并请求
向特定的合并请求添加评论(备注)。适用于代码审查。
./scripts/gitlab_api.js comment_mr "<project_path>" <mr_iid> "<comment_body>"
4. 创建议题
开启一个新议题。
./scripts/gitlab_api.js create_issue "<project_path>" "<title>" "<description>"
示例
创建一个私有仓库:
GITLAB_TOKEN=... ./scripts/gitlab_api.js create_repo "new-tool" "A cool new tool" "private"
审查一个合并请求:
# First list to find ID
GITLAB_TOKEN=... ./scripts/gitlab_api.js list_mrs "jorgermp/my-tool" "opened"
# Then comment
GITLAB_TOKEN=... ./scripts/gitlab_api.js comment_mr "jorgermp/my-tool" 1 "Great work, but check indentation."
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~