Token导航 LogoToken导航TokenDH.com
效率敏感数据clawhub未标认证来源可访问clear审计提醒

gitlab-skillGitLab 技能

Agent Skill

用于围绕 GitLab 项目、Merge Request、Issue、分支、流水线和代码审查流程提供辅助能力。它适合让 Agent 查询项目状态、整理提交差异、辅助检查合并请求或汇总 CI 结果。使用时需要确认项目权限、访问 token 和目标分支范围;涉及合并、推送、改工单或触发流水线时,应先预览影响并核对团队流程。

总安装

3,969

周安装

159

GitHub Stars

公开资料未说明

下载量

1,285
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gitlab-skill(GitLab 技能)
来源仓库:https://github.com/pickbert/gitlab-skill
安装命令:
openclaw skills install gitlab-skill
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install gitlab-skill

简介

封装常用 GitLab 操作,包括仓库创建、克隆、Issue 管理等。

  • 简化 Agent 在 GitLab 平台上的日常协作任务处理。
  • 支持分支、提交、管道触发等基础功能集成。
  • 使用前需验证 API token 权限范围及网络连通性。
  • gitlab-skill 属于效率类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
gitlab
description
GitLab operations including creating and cloning repositories, listing projects, managing issues, merge requests, branches, commits, and pipelines. Use this skill for creating/cloning GitLab repos, browsing projects, creating/updating issues and MRs, and any GitLab API interaction. Supports both API operations and git operations.

GitLab Operations

This skill enables comprehensive GitLab operations including creating and cloning repositories, listing projects, managing issues, merge requests, branches, commits, pipelines, and more.

Configuration

The GitLab skill uses a secure, layered credential management system. Credentials are loaded in the following priority order:

1. Environment Variables (Recommended - Most Secure) ⭐

Set GitLab credentials as environment variables:

export GITLAB_HOST="https://gitlab.example.com"
export GITLAB_TOKEN="glpat-your-token-here"

Benefits:

  • Most secure approach
  • Never committed to version control
  • Standard practice for production systems
  • Works seamlessly with CI/CD pipelines

Generating a GitLab Access Token:

  1. Go to GitLab → User Settings → Access Tokens
  2. Create a personal access token with appropriate scopes:

- api - Full API access - read_repository - For repository operations - write_repository - For creating branches, commits, etc.

  1. Copy the token immediately (you won't see it again)

Persistent Configuration: Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):

export GITLAB_HOST="https://gitlab.example.com"
export GITLAB_TOKEN="glpat-your-token-here"

2. User Configuration File

Create a configuration file in your home directory:

mkdir -p ~/.claude
cat > ~/.claude/gitlab_config.json << 'EOF'
{
  "host": "https://gitlab.example.com",
  "access_token": "glpat-your-token-here"
}
EOF

chmod 600 ~/.claude/gitlab_config.json  # Restrict file permissions

Location: ~/.claude/gitlab_config.json

Benefits:

  • Secure location outside skill directory
  • Won't be accidentally committed
  • Easy to manage multiple GitLab instances
  • Supports file-based automation

3. Runtime Prompt (Fallback)

If credentials are not found in environment variables or config files, the skill can prompt for credentials interactively (when the --allow-prompt flag is used):

python3 scripts/gitlab_api.py projects --allow-prompt

Note: This is not recommended for automation or CI/CD pipelines.

Configuration Priority

The skill loads credentials in this order (first match wins):

  1. Environment Variables (GITLAB_HOST, GITLAB_TOKEN) - Highest Priority
  2. User Config File (~/.claude/gitlab_config.json)
  3. Legacy Config (scripts/config.json - deprecated, shows warning)
  4. Runtime Prompt (only if --allow-prompt flag is used)

Example Config File Template

An example configuration template is available at scripts/config.example.json:

{
  "host": "https://gitlab.example.com",
  "access_token": "glpat-your-token-here"
}

Important Security Notes

DO: ✅ Use environment variables for production systems ✅ Store user config in ~/.claude/gitlab_config.json ✅ Restrict file permissions: chmod 600 ~/.claude/gitlab_config.json ✅ Use different tokens for different environments ✅ Rotate tokens regularly

DON'T: ❌ Commit credentials to version control ❌ Store real tokens in scripts/config.json ❌ Share access tokens in chat logs or output ❌ Use the same token across multiple environments ❌ Print or log access tokens

SSL Certificate Issues

For internal GitLab instances with self-signed certificates, use the --insecure flag:

python3 scripts/gitlab_api.py projects --insecure

This bypasses SSL certificate verification (useful for development/testing but not recommended for production).

Testing Credential Loading

Test that credentials are configured correctly:

# Test using credential loader directly
python3 scripts/credential_loader.py --show-source

# List projects to verify API access
python3 scripts/gitlab_api.py projects

# Check which credential source is being used
python3 scripts/gitlab_api.py projects --allow-prompt

Troubleshooting

Problem: "GitLab credentials not configured"

Solutions:

  1. Check environment variables: echo $GITLAB_HOST $GITLAB_TOKEN
  2. Check user config: cat ~/.claude/gitlab_config.json
  3. Verify token is valid and not expired
  4. Ensure token has required API scopes

Problem: "Authentication failed (401)"

Solutions:

  1. Verify token hasn't expired or been revoked
  2. Check token has required scopes (api, read_repository, etc.)
  3. Ensure token format is correct (starts with glpat-)
  4. Test token manually:
   curl -H "PRIVATE-TOKEN: $GITLAB_TOKEN" "$GITLAB_HOST/api/v4/user"

Problem: "Resource not found (404)"

Solutions:

  1. Verify GitLab host URL is correct
  2. Check project ID or path
  3. Ensure user has access to the project
  4. Test with python3 scripts/gitlab_api.py projects to list accessible projects

Migration from Old Configuration

If you have an existing scripts/config.json file:

  1. Immediate Action: Move credentials to secure location
   # Export to environment variables
   export GITLAB_HOST=$(jq -r '.host' scripts/config.json)
   export GITLAB_TOKEN=$(jq -r '.access_token' scripts/config.json)

   # Or move to user config
   mkdir -p ~/.claude
   cp scripts/config.json ~/.claude/gitlab_config.json
   chmod 600 ~/.claude/gitlab_config.json
  1. Replace config.json with placeholder:
   cat > scripts/config.json << 'EOF'
   {
     "_comment": "This file is deprecated",
     "host": "https://gitlab.example.com",
     "access_token": "glpat-your-token-here"
   }
   EOF
  1. Verify new configuration works:
   python3 scripts/credential_loader.py --show-source
   python3 scripts/gitlab_api.py projects

Common Operations

Create Repository

When the user wants to create a new GitLab repository:

  1. Prompt for required information:

- Project name (required) - Description (optional) - Visibility level: public, private, or internal (optional, defaults to private) - Namespace/group path (optional, defaults to user's personal namespace) - Initialize with README (optional, defaults to false)

  1. Use POST /api/v4/projects endpoint with the provided parameters
  2. Include additional options if specified:

- initialize_with_readme: Create repository with initial README - default_branch: Set default branch name (defaults to "main") - wiki_enabled: Enable wiki (defaults to true) - issues_enabled: Enable issues (defaults to true) - merge_requests_enabled: Enable merge requests (defaults to true) - jobs_enabled: Enable CI/CD pipelines (defaults to true)

  1. Handle response and provide:

- Project URL - Git clone URL - Web URL - Project ID - Confirmation with formatted Markdown output

Example output format:

## ✅ Repository Created Successfully

**Project**: my-project
**Project ID**: 123
**Visibility**: Private
**URL**: [View Project](https://gitlab.example.com/username/my-project)
**Clone**: `git clone https://gitlab.example.com/username/my-project.git`

Error handling:

  • Name already exists: Suggest alternative names
  • Invalid namespace: List available namespaces
  • Permission denied: Check user permissions and token scopes

Clone Repository

When the user wants to clone a GitLab repository:

  1. Parse the repository URL to extract the project path and host
  2. Verify the host matches the configured GitLab instance in config.json
  3. If authentication is required for private repositories, use the access token from config
  4. Clone to the specified directory or current directory if not specified
  5. Use git clone with appropriate authentication:

- For HTTPS: use token as password - For SSH: use git@host:project-path.git format

  1. Confirm successful clone with repository path and brief info

Example workflow:

User: "clone https://gitlab.example.com/group/project to ./myproject"
Action:
1. Extract host (gitlab.example.com) and project path (group/project)
2. Run git clone with authentication
3. Confirm: "✅ Cloned to ./myproject"

Authentication note: For private repos requiring HTTPS auth, embed token in URL: https://oauth2:TOKEN@host/project.git

List Repositories/Projects

When the user wants to see their GitLab repositories:

  1. Load configuration from config.json
  2. Fetch all projects using the GitLab API (/api/v4/projects)
  3. Use membership=true to show only projects the user is a member of
  4. Sort by updated_at descending to show recently updated projects first
  5. Handle pagination automatically to fetch all projects
  6. Output results in Markdown format with:

- Project count summary - Formatted table with: Name, Visibility, Last Updated, URL - Group/namespace information if relevant - Links to each project

Example output format:

## Found 25 GitLab Projects

| Name | Visibility | Last Updated | URL |
|------|------------|--------------|-----|
| group/project-name | Public | 2025-04-02 | [View](https://gitlab.example.com/group/project-name) |
...

Search Projects

When the user wants to search for specific projects:

  1. Use the /api/v4/projects endpoint with search=<query> parameter
  2. Filter by visibility if requested (visibility=public|private|internal)
  3. Limit results to top 20 matches unless more are requested
  4. Output in Markdown table format

Project Details

When the user asks about a specific project:

  1. Use /api/v4/projects/:id endpoint (project ID or path-encoded URL)
  2. Fetch detailed information including:

- Description, default branch, star count, forks count - Last activity date - Repository size - Permissions

  1. Output in formatted Markdown with sections for each detail category

Issues

List issues:

  • Use /api/v4/projects/:id/issues for project-specific issues
  • Use /api/v4/issues for all issues across projects
  • Support filtering: state (opened/closed), labels, milestone, assignee
  • Output in Markdown table with: ID, Title, State, Author, Assignee, Updated, Link

Create issue:

  • Use POST /api/v4/projects/:id/issues
  • Required: title
  • Optional: description, labels, assignee_id, milestone_id
  • Ask user for missing required information
  • Confirm creation and show the issue URL

Get issue details:

  • Use GET /api/v4/projects/:id/issues/:issue_iid
  • Fetch complete issue information including description, labels, assignees
  • Output formatted Markdown with all issue details
  • Show state icon (🟢 opened, 🔴 closed), author, assignees, labels, milestone
  • Display full description and link to issue in GitLab
  • Handle missing fields gracefully with "None" or "Unassigned" placeholders

Update issue:

  • Use PUT /api/v4/projects/:id/issues/:issue_iid
  • Allow updating title, description, state, labels, etc.
  • Confirm changes and show updated issue link

Merge Requests

List merge requests:

  • Use /api/v4/projects/:id/merge_requests for project-specific MRs
  • Use /api/v4/merge_requests for all MRs across projects
  • Support filtering: state (opened/closed/merged), author, assignee, labels
  • Output in Markdown table with: IID, Title, State, Author, Target Branch, Source Branch, Link

Create merge request:

  • Use POST /api/v4/projects/:id/merge_requests
  • Required: source_branch, target_branch, title
  • Optional: description, assignee_id, labels, remove_source_branch
  • Ask user for missing required information
  • Confirm creation and show MR URL

Show MR details:

  • Fetch MR with discussions, changes, and pipeline status
  • Output comprehensive Markdown with:

- Basic info (title, state, branches, author) - Changes summary (files changed, additions, deletions) - Pipeline status if available - Recent discussions/comments

Branches

List branches:

  • Use /api/v4/projects/:id/repository/branches
  • Show name, protected status, commit info, last commit date
  • Output in Markdown table

Create branch:

  • Use POST /api/v4/projects/:id/repository/branches
  • Required: branch_name, ref (starting branch or commit SHA)
  • Confirm creation with branch details including:

- Branch name and protection status (🔒 protected icon) - Latest commit SHA, message, author, and date - Link to branch in GitLab

  • Handle errors gracefully:

- Branch already exists (400 error) - Invalid branch name or ref (400 error) - Invalid project or insufficient permissions (403/404 errors)

Delete branch:

  • Use DELETE /api/v4/projects/:id/repository/branches/:branch
  • Warn before deletion
  • Confirm deletion

Commits

List commits:

  • Use /api/v4/projects/:id/repository/commits
  • Support filtering: ref_name (branch), since, until, author
  • Show short SHA, author, message, date
  • Output in Markdown table with links to commit diffs

Show commit details:

  • Use /api/v4/projects/:id/repository/commits/:sha
  • Show full commit message, author, committer, file changes
  • Display diff summary

Pipelines

List pipelines:

  • Use /api/v4/projects/:id/pipelines
  • Show ID, status, ref, user, created date, duration
  • Output in Markdown table with status indicators (✅ ✗ ⏳)

Show pipeline details:

  • Fetch pipeline jobs and stages
  • Display job status, duration, and logs URLs
  • Show overall pipeline status and timing

Error Handling

When encountering errors:

  1. Authentication failed (401/403):

- Inform user the access token may be invalid or lacks required permissions - Suggest checking config.json or generating a new token with appropriate scopes

  1. Project not found (404):

- Verify project ID or path - Check if user has access to the project - Suggest listing projects to find the correct ID

  1. Rate limiting (429):

- Inform user about rate limits - Suggest waiting before retrying

  1. Network errors:

- Check if GitLab host is reachable - Verify network connection - For internal GitLab instances with self-signed certificates, handle SSL verification appropriately

  1. Invalid parameters:

- Explain what parameter was invalid - Provide guidance on correct values - Show API documentation links if relevant

API Pagination

For endpoints that return paginated results:

  1. Check x-total-pages header
  2. Iterate through all pages to fetch complete results
  3. For large result sets (>100 items), ask user if they want all results or just the first N
  4. Show progress when fetching multiple pages

Output Formatting Principles

  1. Use Markdown for all human-readable output - tables, lists, code blocks
  2. Include links to relevant GitLab resources - project URLs, issue links, MR links
  3. Show counts and summaries - total results, filtered counts
  4. Use visual indicators for status - ✅ for success, ✗ for failure, ⏳ for pending
  5. Format dates in readable format - YYYY-MM-DD or relative time (2 days ago)
  6. Truncate long text - commit messages, descriptions, with option to show full text
  7. Group related information - use headers and sections for complex outputs

Interactive Workflows

For complex operations requiring multiple steps:

  1. Ask for confirmation before destructive operations (delete, close, etc.)
  2. Offer choices when there are multiple valid approaches
  3. Suggest next actions after completing an operation (e.g., after creating an issue, ask if they want to create another)
  4. Handle ambiguous inputs - if a project name is ambiguous, show matching projects and ask user to select

Example Workflows

User asks: "Show me my open merge requests"

Action:

  1. Fetch MRs from all projects using /api/v4/merge_requests?state=opened
  2. Group by project
  3. Output in Markdown table with project name, MR details, and links

User asks: "Create an issue in myproject about the login bug"

Action:

  1. Load config.json
  2. Find project ID for "myproject"
  3. Ask for issue details if not provided (description, labels, assignee)
  4. Create the issue via API
  5. Confirm creation and show issue URL

User asks: "What's the status of the main branch in project-group/webapp?"

Action:

  1. Find project by name/path
  2. Fetch branch details for "main"
  3. Show commit info, protection status
  4. Optionally show recent commits or pipeline status

Notes

  • All API calls should include the access token in the PRIVATE-TOKEN header
  • Use proper SSL/TLS handling for internal GitLab instances with self-signed certificates
  • Respect rate limits and implement exponential backoff if needed
  • Cache project ID lookups when appropriate to avoid repeated API calls

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

74.19%
按下载量换算953

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills