feat(notification): add message notification shortcuts #315
Loading…
Reference in New Issue
No description provided.
Delete Branch "ohanabi/gitlink-cli:feat/notification-shortcuts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
合并请求描述
本次合并请求新增 GitLink CLI 通知与消息管理快捷命令,围绕用户消息列表、标记已读、删除消息和发送 @ 提及消息提供一组完整
Shortcut,减少
gitlink-notification-digest等 Agent Skill 对 Raw API 的依赖,并补齐测试、文档、i18n 与 Skill 说明。相关Issue
关联Issue编号:暂无
变更内容
1. 增强了通知消息查看能力
新增
notification +list,支持查看当前认证用户或指定用户的消息列表,并支持--type、--status、--page、--limit等筛选参数。
2. 增强了消息已读管理能力
新增
notification +read,支持通过--ids将指定消息标记为已读,也支持通过--all-unread将所选类型的全部未读消息标记为已读。
3. 增强了消息删除能力
新增
notification +delete,支持按消息 ID 删除指定消息,并通过--dry-run和--yes防止误删。4. 增强了 @ 提及消息发送能力
新增
notification +send-atme,支持向指定用户发送 @ 提及消息,可关联Journal、Issue或PullRequest目标对象。5. 补齐了配套文档和测试
新增
shortcuts/notification单元测试,更新命令注册、README、README.zh-CN、i18n 文案、Skill 总览、gitlink-notificationSkill、
gitlink-notification-digestSkill 和变更说明文档。问题描述
此前 GitLink CLI 没有通知/消息管理相关 Shortcut,通知摘要类 Agent Skill 只能直接拼接 Raw API 路径访问 messages 接口。
这会增加用户和 Agent 的使用成本,也容易出现路径拼写、参数遗漏、误读 GitLink “messages/notifications” 术语差异等问题。
同时,标记已读、删除消息、发送 @ 消息都属于远端写操作,缺少统一的 dry-run 和显式确认机制。
问题复现步骤
notification或atme类型筛选消息。根本原因
CLI 的 Shortcut 层此前未覆盖 GitLink 用户消息 API。
现有
gitlink-notification-digestSkill 虽然有完整通知摘要场景,但只能依赖 Raw API 调用/api/users/{owner}/messages.json等接口。
消息相关写操作也没有统一的预览和确认保护,不利于人类用户和 AI Agent 安全执行。
修复方案
新增
notificationShortcut 组,对 GitLink messages API 进行封装:notification +listnotification +readnotification +deletenotification +send-atme其中:
notification +list为只读操作,可直接执行。notification +read、notification +delete、notification +send-atme均为写操作,默认不会修改远端状态。--dry-run输出请求方法、路径和 payload。--yes才会真正调用远端 API。notification +read --all-unread使用 GitLink API 的ids: [-1]约定。notification +delete不提供--all-unread,避免误删大量消息。同时更新
gitlink-notification-digestSkill,使其优先使用notification +list和notification +read,减少 Raw API 依赖。测试验证
gofmtgit diff --checkgo run ./internal/i18n/cmd/checkgo test ./shortcuts/notification ./shortcutsgo test ./...Pull request closed