gitlink-cli/skills/gitlink-issue/references/gitlink-issue-update.md

2.0 KiB
Raw Blame History

issue +update

前置条件: 先阅读 ../gitlink-shared/SKILL.md 了解认证、全局参数和安全规则。

Update an existing issue's title, description, or state.

The shortcut reads the current issue first and preserves existing subject and description unless the user explicitly changes them. This prevents partial updates from clearing the issue description.

命令

# Update issue title
gitlink-cli issue +update -n 4 -t "New title"

# Update issue description
gitlink-cli issue +update -n 4 -b "Updated description"

# Update both title and state
gitlink-cli issue +update -n 4 -t "Revised title" -s closed

参数

参数 必填 说明
--number, -n Issue 编号(网页 URL 中的序号)
--title, -t 新标题(映射为 API 字段 subject
--body, -b 新描述(映射为 API 字段 description
--state, -s 新状态: openclosed,或数字状态 ID映射为 API 字段 status_idopen=1closed=5
--owner 仓库所有者(自动从 git remote 解析)
--repo 仓库名称(自动从 git remote 解析)
--format 输出格式: json/table/yaml
--debug 开启调试输出

API

PATCH /v1/{owner}/{repo}/issues/{number}
Body: { "subject": current_or_new_title, "description": current_or_new_body, "status_id": state }

Workflow

  1. Confirm the fields to update and their new values with the user.
  2. Execute gitlink-cli issue +update -n {number} -t "..." -b "...".
  3. Report the updated issue details to the user.

When using Raw API instead of the shortcut, fetch the issue first and include the current subject and description in the update payload.

[!CAUTION] This is a Write Operation -- confirm user intent before executing.

References