SuperAPI AI 工具集

inbox-list-notifications

通用与其它

查看项目

更新于 10-16 00:32

技能介绍

用途:从 GitHub 拉取通知列表,借助 gh CLI 的 gh api 接口自动分页获取未读通知,并可用内置 jq 过滤输出字段,无需外部工具处理 JSON。

主要能力:使用 --paginate 处理分页;使用 --jq 内联过滤,输出 id、reason、unread、updated_at、repo、title、type、url 等字段;支持筛选参与通知、包含已读、指定仓库、按时间 since 过滤;可将 API URL 转换为可点击的 GitHub 链接,并按 reason 优先级排序,如 security_alert、assign、review_requested、mention 等。

使用方式:核心命令为 gh api /notifications --paginate --jq '.[] | {id, reason, unread, updated_at, repo: .repository.full_name, title: .subject.title, type: .subject.type, url: .subject.url}'。规则要求始终为 gh api 调用前置 GH_PAGER=cat 以避免交互式分页;不要将输出管道传给 jq、python 等程序;不要添加 2>/dev/null 或任何重定向;不要将命令包装为脚本;不要添加其他环境变量前缀。筛选时可加 --method GET -f participating=true、-f all=true、-f since=2024-01-01T00:00:00Z,或改用 /repos/{owner}/{repo}/notifications。构造 HTML 链接时,从 API URL 最后一段取编号,pulls 转 https://github.com/{repo}/pull/{number},issues 转 https://github.com/{repo}/issues/{number}。

适用场景:需要在终端快速查看和整理 GitHub 通知、按优先级处理通知、或将 API 结果转为可直接访问的链接时。

限制:依赖已配置的 gh CLI 与认证;资料未提供安装步骤、环境要求、收费与权限细节;必须遵守既定命令与规则,不能改动命令或添加外部处理程序。