360 Secure SkillHub
360 安全技能中心

Gitlab Manager

提供 Node.js 脚本,借助 GITLAB_TOKEN 调用 GitLab.com API,实现创建仓库、列出合并请求、评论 MR 和创建 Issue,适用于代码评审与问题跟踪。

jorgermp
jorgermp
热度 68.81
最近更新 2026-05-11 15:52:26
分类:开发依赖:代码执行 / 第三方 API应用场景:代码审查 / API 集成 / 任务管理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add gitlab-manager
Metadata
name
gitlab-manager
description
Manage GitLab repositories, merge requests, and issues via API. Use for tasks like creating repos, reviewing code in MRs, or tracking issues.

GitLab Manager

This skill allows interaction with GitLab.com via the API.

Prerequisites

  • GITLAB_TOKEN: A Personal Access Token with api scope must be set in the environment.

Usage

Use the provided Node.js script to interact with GitLab.

Script Location

scripts/gitlab_api.js

Commands

1. Create Repository

Create a new project in GitLab.

./scripts/gitlab_api.js create_repo "<name>" "<description>" "<visibility>"
# Visibility: private (default), public, internal

2. List Merge Requests

List MRs for a specific project.

./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. Comment on Merge Request

Add a comment (note) to a specific MR. Useful for code review.

./scripts/gitlab_api.js comment_mr "<project_path>" <mr_iid> "<comment_body>"

4. Create Issue

Open a new issue.

./scripts/gitlab_api.js create_issue "<project_path>" "<title>" "<description>"

Examples

Create a private repo:

GITLAB_TOKEN=... ./scripts/gitlab_api.js create_repo "new-tool" "A cool new tool" "private"

Review an MR:

# 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."