关于 glab-incident
该技能介绍如何用 glab 管理 GitLab 事件,包括列表查看、评论、订阅、关闭和重新打开。文档还说明筛选条件、输出选项及评论附件。
主要功能
- 01列出和查看事件
- 02评论并可附加文件
- 03订阅、关闭或重新打开事件
- 04按负责人和日期筛选列表
- 05选择受支持的列表输出格式
适用场景
- 01发布附有仪表板图片的事件更新
- 02列出分配给某人或无人负责的事件
- 03为脚本选择事件列表输出格式
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ vince-winkintel/ gitlab-cli-skills --skill glab-incident安装后在 Claude Code 中输入/glab-incident确认已加载。
附带文件references/commands.md
详细介绍
原文在翻译后有更新,译文可能不是最新。
glab incident
概览
完整帮助内容来自经过验证的发布二进制文件;不可变捕获 ID
5686d7484对应VERSION中的发布版本和归档校验和。仅移除了行尾空白;缩进、空行、换行、截断内容和产品拼写均保持不变。
Incidents track service disruptions and their resolution. List and
view incidents, comment on them, and subscribe, close, or reopen
them.
Use `--repo` to target a project other than the current one.
USAGE
glab incident [command] [--flags]
EXAMPLES
glab incident list
COMMANDS
close [<id> | <url>] [--flags] Close an incident.
list [--flags] List project incidents.
note <incident-id> [--flags] Comment on an incident in GitLab.
reopen [<id> | <url>] [--flags] Reopen a resolved incident.
subscribe <id> Subscribe to an incident.
unsubscribe <id> Unsubscribe from an incident.
view <id> [--flags] Display the title, body, and other information about an incident.
FLAGS
-h --help Show help for this command.
-R --repo Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.
快速开始
glab incident --help
# Comment with a local attachment
glab incident note 123 --message "Current dashboard state" --attach ./dashboard.png
glab incident list 会在发起请求前验证两个输出选择器:--output 仅接受 text 或 json,而 --output-format 仅接受 details、ids 或 urls。这两个选择器不能同时使用。若立即出现“必须是以下值之一”的错误,应将其视为无效的本地输入,而不是 GitLab API 故障。
将文件附加到事件评论
实验性标志 --attach <path> 会将文件上传到事件所在的项目,并将返回的 Markdown 引用追加到评论中。可以重复使用该标志附加多个文件。附件可以作为整条评论,此时会跳过编辑器;--attach - 则会从标准输入读取附件。
子命令
glab incident list 在文本标题中使用 API 返回的总数,并将其与当前页的行数分开显示。如果 API 未提供总数,标题只会显示当前页的数量。此操作不会获取更多页面,也不会更改 JSON 行输出。
完整的 --help 输出请参阅 references/commands.md。
评论
支持 Markdown