gitlab-label
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLabel Skill
标签技能
Label management operations for GitLab using the CLI.
glab使用 CLI进行GitLab的标签管理操作。
glabQuick Reference
快速参考
| Operation | Command | Risk |
|---|---|---|
| List labels | | - |
| Create label | | ⚠️ |
Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger
| 操作 | 命令 | 风险 |
|---|---|---|
| 列出标签 | | - |
| 创建标签 | | ⚠️ |
风险说明: - 安全 | ⚠️ 注意 | ⚠️⚠️ 警告 | ⚠️⚠️⚠️ 危险
When to Use This Skill
何时使用此技能
ALWAYS use when:
- User wants to manage project labels
- User mentions "label", "tag" (for categorization), "category"
- User wants to organize issues or MRs
NEVER use when:
- User wants to apply labels to issues/MRs (use gitlab-issue or gitlab-mr)
- User wants to manage git tags (use git commands or gitlab-release)
务必在以下场景使用:
- 用户需要管理项目标签
- 用户提及"标签"、"标记"(用于分类)、"类别"
- 用户需要整理议题(Issue)或合并请求(MR)
切勿在以下场景使用:
- 用户需要为议题/合并请求添加标签(使用gitlab-issue或gitlab-mr技能)
- 用户需要管理Git标签(使用Git命令或gitlab-release技能)
Available Commands
可用命令
List Labels
列出标签
bash
glab label list [options]Options:
| Flag | Description |
|---|---|
| Results per page |
| Get all labels |
Examples:
bash
undefinedbash
glab label list [options]选项:
| 标记 | 描述 |
|---|---|
| 每页结果数量 |
| 获取所有标签 |
示例:
bash
undefinedList all project labels
列出所有项目标签
glab label list
glab label list
List with more results
列出更多结果
glab label list --per-page=100
undefinedglab label list --per-page=100
undefinedCreate Label
创建标签
bash
glab label create <name> [options]Options:
| Flag | Description |
|---|---|
| Label color (hex format, e.g., #ff0000) |
| Label description |
Examples:
bash
undefinedbash
glab label create <name> [options]选项:
| 标记 | 描述 |
|---|---|
| 标签颜色(十六进制格式,例如:#ff0000) |
| 标签描述 |
示例:
bash
undefinedCreate label with default color
创建默认颜色的标签
glab label create "needs-review"
glab label create "needs-review"
Create label with color
创建带颜色的标签
glab label create "bug" -c "#ff0000"
glab label create "bug" -c "#ff0000"
Create label with color and description
创建带颜色和描述的标签
glab label create "priority::high"
-c "#dc3545"
-d "High priority items requiring immediate attention"
-c "#dc3545"
-d "High priority items requiring immediate attention"
glab label create "priority::high"
-c "#dc3545"
-d "需要立即处理的高优先级事项"
-c "#dc3545"
-d "需要立即处理的高优先级事项"
Create scoped label
创建范围标签
glab label create "status::in-progress"
-c "#ffc107"
-d "Work in progress"
-c "#ffc107"
-d "Work in progress"
undefinedglab label create "status::in-progress"
-c "#ffc107"
-d "进行中工作"
-c "#ffc107"
-d "进行中工作"
undefinedCommon Label Patterns
常见标签模式
Priority Labels
优先级标签
bash
glab label create "priority::critical" -c "#dc3545" -d "Must fix immediately"
glab label create "priority::high" -c "#fd7e14" -d "Fix in current sprint"
glab label create "priority::medium" -c "#ffc107" -d "Fix soon"
glab label create "priority::low" -c "#28a745" -d "Nice to have"bash
glab label create "priority::critical" -c "#dc3545" -d "必须立即修复"
glab label create "priority::high" -c "#fd7e14" -d "当前迭代修复"
glab label create "priority::medium" -c "#ffc107" -d "尽快修复"
glab label create "priority::low" -c "#28a745" -d "锦上添花的功能"Type Labels
类型标签
bash
glab label create "type::bug" -c "#d73a4a" -d "Something isn't working"
glab label create "type::feature" -c "#0366d6" -d "New feature request"
glab label create "type::docs" -c "#0075ca" -d "Documentation"
glab label create "type::refactor" -c "#6f42c1" -d "Code refactoring"bash
glab label create "type::bug" -c "#d73a4a" -d "功能异常"
glab label create "type::feature" -c "#0366d6" -d "新功能需求"
glab label create "type::docs" -c "#0075ca" -d "文档相关"
glab label create "type::refactor" -c "#6f42c1" -d "代码重构"Status Labels
状态标签
bash
glab label create "status::backlog" -c "#6c757d" -d "In backlog"
glab label create "status::ready" -c "#17a2b8" -d "Ready to start"
glab label create "status::in-progress" -c "#ffc107" -d "Work in progress"
glab label create "status::review" -c "#007bff" -d "In review"
glab label create "status::done" -c "#28a745" -d "Completed"bash
glab label create "status::backlog" -c "#6c757d" -d "待办事项"
glab label create "status::ready" -c "#17a2b8" -d "准备开始"
glab label create "status::in-progress" -c "#ffc107" -d "进行中"
glab label create "status::review" -c "#007bff" -d "审核中"
glab label create "status::done" -c "#28a745" -d "已完成"Workflow Labels
工作流标签
bash
glab label create "needs-review" -c "#d876e3" -d "Needs code review"
glab label create "needs-design" -c "#fbca04" -d "Needs design input"
glab label create "blocked" -c "#b60205" -d "Blocked by external dependency"
glab label create "help-wanted" -c "#008672" -d "Looking for contributors"bash
glab label create "needs-review" -c "#d876e3" -d "需要代码审核"
glab label create "needs-design" -c "#fbca04" -d "需要设计输入"
glab label create "blocked" -c "#b60205" -d "被外部依赖阻塞"
glab label create "help-wanted" -c "#008672" -d "寻求贡献者"GitLab Scoped Labels
GitLab 范围标签
GitLab supports scoped labels using the separator:
::priority::high
status::in-progress
type::bugOnly one label per scope can be applied to an issue/MR, making them mutually exclusive.
GitLab支持使用分隔符的范围标签:
::priority::high
status::in-progress
type::bug每个范围只能有一个标签应用到议题/合并请求,使其互斥。
Common Workflows
常见工作流
Workflow 1: Set Up New Project Labels
工作流1:设置新项目标签
bash
undefinedbash
undefinedCreate priority labels
创建优先级标签
glab label create "priority::critical" -c "#dc3545"
glab label create "priority::high" -c "#fd7e14"
glab label create "priority::medium" -c "#ffc107"
glab label create "priority::low" -c "#28a745"
glab label create "priority::critical" -c "#dc3545"
glab label create "priority::high" -c "#fd7e14"
glab label create "priority::medium" -c "#ffc107"
glab label create "priority::low" -c "#28a745"
Create type labels
创建类型标签
glab label create "type::bug" -c "#d73a4a"
glab label create "type::feature" -c "#0366d6"
glab label create "type::docs" -c "#0075ca"
undefinedglab label create "type::bug" -c "#d73a4a"
glab label create "type::feature" -c "#0366d6"
glab label create "type::docs" -c "#0075ca"
undefinedWorkflow 2: Apply Labels to Issues
工作流2:为议题添加标签
bash
undefinedbash
undefinedList available labels
列出可用标签
glab label list
glab label list
Create issue with labels
创建带标签的议题
glab issue create -t "Fix login bug" -l "type::bug,priority::high"
glab issue create -t "修复登录bug" -l "type::bug,priority::high"
Update issue labels
更新议题标签
glab issue update 42 -l "status::in-progress"
undefinedglab issue update 42 -l "status::in-progress"
undefinedColor Reference
颜色参考
Common colors for labels:
| Color | Hex | Use For |
|---|---|---|
| Red | | Bugs, critical, blocked |
| Orange | | High priority, warning |
| Yellow | | Medium priority, in-progress |
| Green | | Done, low priority, good first issue |
| Blue | | Features, info, review |
| Purple | | Refactor, enhancement |
| Gray | | Backlog, wontfix |
标签常用颜色:
| 颜色 | 十六进制 | 用途 |
|---|---|---|
| 红色 | | Bug、严重问题、阻塞 |
| 橙色 | | 高优先级、警告 |
| 黄色 | | 中优先级、进行中 |
| 绿色 | | 已完成、低优先级、新手友好任务 |
| 蓝色 | | 功能、信息、审核 |
| 紫色 | | 重构、增强 |
| 灰色 | | 待办、不会修复 |
Troubleshooting
故障排除
| Issue | Cause | Solution |
|---|---|---|
| Authentication failed | Invalid/expired token | Run |
| Label already exists | Duplicate name | Use different name or update existing |
| Invalid color | Wrong format | Use hex format: #RRGGBB |
| Permission denied | Not maintainer | Need maintainer+ role |
| 问题 | 原因 | 解决方法 |
|---|---|---|
| 认证失败 | 令牌无效/过期 | 运行 |
| 标签已存在 | 名称重复 | 使用不同名称或更新现有标签 |
| 无效颜色 | 格式错误 | 使用十六进制格式:#RRGGBB |
| 权限不足 | 不是维护者 | 需要维护者及以上角色 |
Related Documentation
相关文档
- Safeguards
- Quick Reference
- 安全防护
- 快速参考