gitlab-assistant
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitLab Assistant
GitLab 助手
Central hub for GitLab automation using the CLI. Routes requests to the most appropriate specialized skill.
glab基于 CLI的GitLab自动化中心,可将请求路由至最合适的专门技能模块。
glabQuick Reference
快速参考
| I want to... | Use this skill | Risk |
|---|---|---|
| Work with merge requests | | ⚠️ |
| Work with issues | | ⚠️ |
| Check/run CI pipelines | | ⚠️ |
| Clone/fork/create repos | | ⚠️ |
| Manage releases | | ⚠️ |
| Manage labels | | ⚠️ |
| Manage milestones | | ⚠️ |
| Manage CI/CD variables | | ⚠️ |
| Manage groups/teams | | ⚠️ |
| Search GitLab | | - |
| Protect branches | | ⚠️ |
| Manage webhooks | | ⚠️ |
| Repository file operations | | ⚠️ |
| Manage wiki pages | | ⚠️ |
| MR/Issue discussions | | ⚠️ |
| Project badges | | ⚠️ |
| Container registry | | ⚠️⚠️ |
| Security vulnerabilities | | ⚠️ |
Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger
| 我想要... | 使用该技能模块 | 风险 |
|---|---|---|
| 处理合并请求 | | ⚠️ |
| 处理议题 | | ⚠️ |
| 查看/运行CI流水线 | | ⚠️ |
| 克隆/复刻/创建仓库 | | ⚠️ |
| 管理版本发布 | | ⚠️ |
| 管理标签 | | ⚠️ |
| 管理里程碑 | | ⚠️ |
| 管理CI/CD变量 | | ⚠️ |
| 管理群组/团队 | | ⚠️ |
| 搜索GitLab内容 | | - |
| 保护分支 | | ⚠️ |
| 管理Webhook | | ⚠️ |
| 仓库文件操作 | | ⚠️ |
| 管理Wiki页面 | | ⚠️ |
| MR/议题讨论 | | ⚠️ |
| 项目徽章 | | ⚠️ |
| 容器镜像仓库 | | ⚠️⚠️ |
| 安全漏洞管理 | | ⚠️ |
风险说明: - 安全 | ⚠️ 注意 | ⚠️⚠️ 警告 | ⚠️⚠️⚠️ 危险
Routing Rules
路由规则
Rule 1: Explicit Resource Type
规则1:明确资源类型
Route based on the GitLab resource being worked with:
| Keywords | Route to |
|---|---|
| MR, merge request, pull request, review, approve, merge | |
| issue, bug, ticket, task, feature request | |
| CI, CD, pipeline, build, job, deploy, artifacts | |
| repo, repository, project, clone, fork | |
| release, tag, version, changelog | |
| label, tag (for issues/MRs) | |
| milestone, sprint, iteration | |
| variable, secret, env, CI variable | |
| group, team, organization, members, namespace | |
| search, find, query (global/group/project) | |
| protect branch, branch protection, access rules | |
| webhook, hook, notification callback, integration | |
| file, blob, content, raw (repository files) | |
| wiki, documentation page | |
| discussion, thread, comment, note, reply | |
| badge, status badge, coverage badge | |
| container, registry, docker, image, tag (container) | |
| vulnerability, security, scan, CVE, SAST, DAST | |
根据操作的GitLab资源类型进行路由:
| 关键词 | 路由至 |
|---|---|
| MR, merge request, pull request, review, approve, merge | |
| issue, bug, ticket, task, feature request | |
| CI, CD, pipeline, build, job, deploy, artifacts | |
| repo, repository, project, clone, fork | |
| release, tag, version, changelog | |
| label, tag(用于议题/MR分类) | |
| milestone, sprint, iteration | |
| variable, secret, env, CI variable | |
| group, team, organization, members, namespace | |
| search, find, query(全局/群组/项目范围) | |
| protect branch, branch protection, access rules | |
| webhook, hook, notification callback, integration | |
| file, blob, content, raw(仓库文件) | |
| wiki, documentation page | |
| discussion, thread, comment, note, reply | |
| badge, status badge, coverage badge | |
| container, registry, docker, image, tag(容器) | |
| vulnerability, security, scan, CVE, SAST, DAST | |
Rule 2: Common Workflows
规则2:常见工作流
| Workflow | Skills Involved |
|---|---|
| Code review | |
| Bug tracking | |
| Deployment | |
| Release process | |
| Project setup | |
| 工作流 | 涉及的技能模块 |
|---|---|
| 代码评审 | |
| 缺陷追踪 | |
| 部署 | |
| 发布流程 | |
| 项目初始化 | |
Rule 3: Multi-Step Operations
规则3:多步骤操作
For complex workflows that span multiple skills, coordinate them:
Example: "Release version 1.2.0"
1. gitlab-mr: Ensure all MRs are merged
2. gitlab-ci: Verify pipeline passes
3. gitlab-release: Create release with changelog对于跨多个技能模块的复杂工作流,需协同执行:
示例:"发布版本1.2.0"
1. gitlab-mr:确保所有MR已合并
2. gitlab-ci:验证流水线执行通过
3. gitlab-release:创建带更新日志的版本发布Skills Overview
技能模块概览
gitlab-mr (Merge Requests)
gitlab-mr(合并请求)
- Purpose: Create, review, approve, and merge MRs
- Key commands: ,
glab mr list,glab mr create,glab mr checkoutglab mr merge - Risk: ⚠️ (merge is destructive)
- Triggers: MR, merge request, review, approve, merge, checkout
- 用途:创建、评审、批准和合并MR
- 核心命令:,
glab mr list,glab mr create,glab mr checkoutglab mr merge - 风险:⚠️(合并操作具有破坏性)
- 触发词:MR, merge request, review, approve, merge, checkout
gitlab-issue (Issues)
gitlab-issue(议题)
- Purpose: Track bugs, features, and tasks
- Key commands: ,
glab issue list,glab issue createglab issue close - Risk: ⚠️ (close/delete are destructive)
- Triggers: issue, bug, task, ticket, feature
- 用途:追踪缺陷、需求和任务
- 核心命令:,
glab issue list,glab issue createglab issue close - 风险:⚠️(关闭/删除操作具有破坏性)
- 触发词:issue, bug, task, ticket, feature
gitlab-ci (CI/CD Pipelines)
gitlab-ci(CI/CD流水线)
- Purpose: View, trigger, and manage CI/CD pipelines
- Key commands: ,
glab ci status,glab ci view,glab ci runglab ci artifact - Risk: ⚠️ (run triggers compute resources)
- Triggers: CI, pipeline, build, job, deploy, artifacts, lint
- 用途:查看、触发和管理CI/CD流水线
- 核心命令:,
glab ci status,glab ci view,glab ci runglab ci artifact - 风险:⚠️(运行会占用计算资源)
- 触发词:CI, pipeline, build, job, deploy, artifacts, lint
gitlab-repo (Repositories)
gitlab-repo(仓库)
- Purpose: Clone, fork, create, and manage repositories
- Key commands: ,
glab repo clone,glab repo forkglab repo create - Risk: ⚠️⚠️ (delete is highly destructive)
- Triggers: repo, repository, project, clone, fork
- 用途:克隆、复刻、创建和管理仓库
- 核心命令:,
glab repo clone,glab repo forkglab repo create - 风险:⚠️⚠️(删除操作极具破坏性)
- 触发词:repo, repository, project, clone, fork
gitlab-release (Releases)
gitlab-release(版本发布)
- Purpose: Create and manage releases
- Key commands: ,
glab release create,glab release listglab release view - Risk: ⚠️ (creates tags and releases)
- Triggers: release, version, changelog, tag
- 用途:创建和管理版本发布
- 核心命令:,
glab release create,glab release listglab release view - 风险:⚠️(会创建标签和发布记录)
- 触发词:release, version, changelog, tag
gitlab-label (Labels)
gitlab-label(标签)
- Purpose: Manage project labels
- Key commands: ,
glab label createglab label list - Risk: ⚠️ (affects issue/MR categorization)
- Triggers: label, tag (for categorization)
- 用途:管理项目标签
- 核心命令:,
glab label createglab label list - 风险:⚠️(会影响议题/MR的分类)
- 触发词:label, tag(用于分类)
gitlab-milestone (Milestones)
gitlab-milestone(里程碑)
- Purpose: Manage project milestones
- Key commands: ,
glab milestone createglab milestone list - Risk: ⚠️ (affects planning)
- Triggers: milestone, sprint, iteration
- 用途:管理项目里程碑
- 核心命令:,
glab milestone createglab milestone list - 风险:⚠️(会影响项目规划)
- 触发词:milestone, sprint, iteration
gitlab-variable (CI/CD Variables)
gitlab-variable(CI/CD变量)
- Purpose: Manage CI/CD variables and secrets
- Key commands: ,
glab variable setglab variable list - Risk: ⚠️⚠️ (contains secrets)
- Triggers: variable, secret, env var, CI variable
- 用途:管理CI/CD变量和密钥
- 核心命令:,
glab variable setglab variable list - 风险:⚠️⚠️(包含敏感密钥)
- 触发词:variable, secret, env var, CI variable
gitlab-group (Groups - API)
gitlab-group(群组 - API)
- Purpose: Manage groups, members, subgroups via API
- Key commands: ,
glab api groupsglab api groups/:id/members - Risk: ⚠️ (group management)
- Triggers: group, team, organization, members, namespace
- 用途:通过API管理群组、成员、子群组
- 核心命令:,
glab api groupsglab api groups/:id/members - 风险:⚠️(群组管理操作)
- 触发词:group, team, organization, members, namespace
gitlab-search (Search - API)
gitlab-search(搜索 - API)
- Purpose: Search across GitLab (projects, issues, code, etc.)
- Key commands:
glab api "search?scope=...&search=..." - Risk: - (read-only)
- Triggers: search, find, query
- 用途:跨GitLab搜索(项目、议题、代码等)
- 核心命令:
glab api "search?scope=...&search=..." - 风险:-(只读操作)
- 触发词:search, find, query
gitlab-protected-branch (Protected Branches - API)
gitlab-protected-branch(受保护分支 - API)
- Purpose: Manage branch protection rules
- Key commands:
glab api projects/:id/protected_branches - Risk: ⚠️ (affects branch access)
- Triggers: protect branch, branch protection, access rules
- 用途:管理分支保护规则
- 核心命令:
glab api projects/:id/protected_branches - 风险:⚠️(会影响分支访问权限)
- 触发词:protect branch, branch protection, access rules
gitlab-webhook (Webhooks - API)
gitlab-webhook(Webhook - API)
- Purpose: Manage project webhooks
- Key commands:
glab api projects/:id/hooks - Risk: ⚠️ (external integrations)
- Triggers: webhook, hook, notification, integration
- 用途:管理项目Webhook
- 核心命令:
glab api projects/:id/hooks - 风险:⚠️(涉及外部集成)
- 触发词:webhook, hook, notification, integration
gitlab-file (Repository Files - API)
gitlab-file(仓库文件 - API)
- Purpose: Read/write repository files via API
- Key commands:
glab api projects/:id/repository/files/:path - Risk: ⚠️ (modifies files)
- Triggers: file, blob, content, raw
- 用途:通过API读写仓库文件
- 核心命令:
glab api projects/:id/repository/files/:path - 风险:⚠️(会修改文件内容)
- 触发词:file, blob, content, raw
gitlab-wiki (Wiki - API)
gitlab-wiki(Wiki - API)
- Purpose: Manage project wiki pages
- Key commands:
glab api projects/:id/wikis - Risk: ⚠️ (documentation changes)
- Triggers: wiki, documentation page
- 用途:管理项目Wiki页面
- 核心命令:
glab api projects/:id/wikis - 风险:⚠️(会修改文档内容)
- 触发词:wiki, documentation page
gitlab-discussion (Discussions - API)
gitlab-discussion(讨论 - API)
- Purpose: Manage threaded discussions on MRs/issues
- Key commands:
glab api projects/:id/merge_requests/:iid/discussions - Risk: ⚠️ (comments)
- Triggers: discussion, thread, comment, note, reply
- 用途:管理MR/议题上的线程式讨论
- 核心命令:
glab api projects/:id/merge_requests/:iid/discussions - 风险:⚠️(会添加评论内容)
- 触发词:discussion, thread, comment, note, reply
gitlab-badge (Badges - API)
gitlab-badge(徽章 - API)
- Purpose: Manage project badges
- Key commands:
glab api projects/:id/badges - Risk: ⚠️ (project display)
- Triggers: badge, status badge, coverage badge
- 用途:管理项目徽章
- 核心命令:
glab api projects/:id/badges - 风险:⚠️(会影响项目展示)
- 触发词:badge, status badge, coverage badge
gitlab-container (Container Registry - API)
gitlab-container(容器镜像仓库 - API)
- Purpose: Manage container registry images and tags
- Key commands:
glab api projects/:id/registry/repositories - Risk: ⚠️⚠️ (delete images is destructive)
- Triggers: container, registry, docker, image
- 用途:管理容器镜像仓库中的镜像和标签
- 核心命令:
glab api projects/:id/registry/repositories - 风险:⚠️⚠️(删除镜像操作具有破坏性)
- 触发词:container, registry, docker, image
gitlab-vulnerability (Vulnerabilities - API)
gitlab-vulnerability(安全漏洞 - API)
- Purpose: Manage security vulnerabilities (Ultimate)
- Key commands:
glab api projects/:id/vulnerabilities - Risk: ⚠️ (security state changes)
- Triggers: vulnerability, security, scan, CVE
- 用途:管理安全漏洞(需Ultimate版本)
- 核心命令:
glab api projects/:id/vulnerabilities - 风险:⚠️(会修改安全状态)
- 触发词:vulnerability, security, scan, CVE
Connection Verification
连接验证
Before any operation, verify GitLab is configured:
bash
glab auth statusIf not authenticated:
bash
glab auth loginCheck current repository context:
bash
glab repo view在执行任何操作前,请验证GitLab配置是否正确:
bash
glab auth status若未认证,请执行:
bash
glab auth login查看当前仓库上下文:
bash
glab repo viewCommon glab Commands Quick Reference
常用glab命令速查
bash
undefinedbash
undefinedAuthentication
认证
glab auth login # Interactive login
glab auth status # Check auth status
glab auth login # 交互式登录
glab auth status # 查看认证状态
Merge Requests
合并请求
glab mr list # List MRs
glab mr create # Create MR
glab mr view <id> # View MR details
glab mr checkout <id> # Checkout MR branch
glab mr merge <id> # Merge MR
glab mr list # 列出MR
glab mr create # 创建MR
glab mr view <id> # 查看MR详情
glab mr checkout <id> # 检出MR分支
glab mr merge <id> # 合并MR
Issues
议题
glab issue list # List issues
glab issue create # Create issue
glab issue view <id> # View issue
glab issue close <id> # Close issue
glab issue list # 列出议题
glab issue create # 创建议题
glab issue view <id> # 查看议题
glab issue close <id> # 关闭议题
CI/CD
CI/CD
glab ci status # Current pipeline status
glab ci view # Interactive pipeline view
glab ci run # Trigger pipeline
glab ci artifact # Download artifacts
glab ci status # 当前流水线状态
glab ci view # 交互式查看流水线
glab ci run # 触发流水线
glab ci artifact # 下载制品
Repository
仓库
glab repo clone <path> # Clone repository
glab repo fork <path> # Fork repository
glab repo view # View repo info
undefinedglab repo clone <path> # 克隆仓库
glab repo fork <path> # 复刻仓库
glab repo view # 查看仓库信息
undefinedDisambiguation
歧义处理
When request is ambiguous, ask for clarification:
| Ambiguous Request | Clarifying Question |
|---|---|
| "Show me the status" | "Do you want CI pipeline status ( |
| "Create a new one" | "What would you like to create? An issue, MR, or repository?" |
| "List everything" | "What would you like to list? MRs, issues, pipelines, or repos?" |
当请求存在歧义时,请询问用户以澄清:
| 歧义请求 | 澄清问题 |
|---|---|
| "Show me the status" | "你需要查看CI流水线状态( |
| "Create a new one" | "你想要创建什么?议题、MR还是仓库?" |
| "List everything" | "你想要列出什么?MR、议题、流水线还是仓库?" |
Related Documentation
相关文档
- Decision Tree
- API Helpers
- Safeguards
- Quick Reference
- 决策树
- API助手
- 安全防护
- 快速参考