feat(label): add issue label shortcuts #89

Merged
wbtiger merged 1 commits from recorder/gitlink-cli:feat/label-shortcuts into master 2026-05-31 23:41:28 +08:00
Contributor

背景

Issue 标签(项目标记 / issue_tags)此前只能通过 Raw API 管理;gitlink-code-review、gitlink-insight 等 Skill 在做 Issue 分拣 / 打标签时都需手工拼 issue_tag_ids 请求。本 PR 将其封装为一等 label shortcut 组。

改动

  • 新增 shortcuts/label/:label +list / +create / +update / +delete
  • +list 支持 --keyword / --only-name / --sort-by / --sort-direction(映射到 order_by / order_direction)
  • +create 的 --color 缺省 #1E90FF,并做十六进制客户端校验,非法颜色在调用 API 前即报错
  • +update 先从列表取标签当前值再与传入字段合并,避免漏传字段被清空(更新接口要求 name/description/color 同时提交)
  • 配套 Skill skills/gitlink-label/SKILL.md;README(中/英)补充 Label Management 段;新增 doc/changes/label-shortcut.md
  • 顺手补 .gitignore:此前只忽略 gitlink-cli.exe,未忽略 macOS/Linux 的 gitlink-cli 构建产物

测试

  • make check(gofmt + vet + go test -race)全绿;label_test.go 覆盖各命令的 HTTP 方法/路径/查询/payload,以及颜色校验与 id 归一化
  • 已在真实平台跑通 +create -> +list -> +update -> +delete 全流程(均返回 status: 0)

涉及端点

GET/POST /api/v1/{owner}/{repo}/issue_tags,PATCH/DELETE /api/v1/{owner}/{repo}/issue_tags/{id}

## 背景 Issue 标签(项目标记 / issue_tags)此前只能通过 Raw API 管理;gitlink-code-review、gitlink-insight 等 Skill 在做 Issue 分拣 / 打标签时都需手工拼 issue_tag_ids 请求。本 PR 将其封装为一等 label shortcut 组。 ## 改动 - 新增 shortcuts/label/:label +list / +create / +update / +delete - +list 支持 --keyword / --only-name / --sort-by / --sort-direction(映射到 order_by / order_direction) - +create 的 --color 缺省 #1E90FF,并做十六进制客户端校验,非法颜色在调用 API 前即报错 - +update 先从列表取标签当前值再与传入字段合并,避免漏传字段被清空(更新接口要求 name/description/color 同时提交) - 配套 Skill skills/gitlink-label/SKILL.md;README(中/英)补充 Label Management 段;新增 doc/changes/label-shortcut.md - 顺手补 .gitignore:此前只忽略 gitlink-cli.exe,未忽略 macOS/Linux 的 gitlink-cli 构建产物 ## 测试 - make check(gofmt + vet + go test -race)全绿;label_test.go 覆盖各命令的 HTTP 方法/路径/查询/payload,以及颜色校验与 id 归一化 - 已在真实平台跑通 +create -> +list -> +update -> +delete 全流程(均返回 status: 0) ## 涉及端点 GET/POST /api/v1/{owner}/{repo}/issue_tags,PATCH/DELETE /api/v1/{owner}/{repo}/issue_tags/{id}
recorder added 1 commit 2026-05-31 00:43:31 +08:00
cca3d019fe feat(label): add issue label shortcuts
Add a `label` shortcut group wrapping the GitLink issue_tags (项目标记) API
with +list / +create / +update / +delete, plus the gitlink-label Skill,
bilingual README usage, and a changelog entry.

- +list supports keyword filter, only-name, and sort options
- +create defaults color to #1E90FF and validates hex client-side
- +update fetches current values and merges, preserving unspecified fields
- unit tests cover HTTP method, path, query, payload, color validation, id coercion
- ignore the local `gitlink-cli` build artifact (.gitignore previously only
  ignored the Windows .exe)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
wbtiger merged commit a91d553130 into master 2026-05-31 23:41:28 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#89
No description provided.