forked from Gitlink/gitlink-cli
1.4 KiB
1.4 KiB
issue +close
前置条件: 先阅读
../gitlink-shared/SKILL.md了解认证、全局参数和安全规则。
Close an issue. Automatically fetches the current issue subject and description, then sets status_id=5 (closed) without clearing the description.
命令
# Close issue #42
gitlink-cli issue +close -i 42
参数
| 参数 | 必填 | 说明 |
|---|---|---|
--id, -i |
是 | Issue ID |
--owner |
否 | 仓库所有者(自动从 git remote 解析) |
--repo |
否 | 仓库名称(自动从 git remote 解析) |
--format |
否 | 输出格式: json/table/yaml |
--debug |
否 | 开启调试输出 |
API
The command performs two API calls:
- Fetch the issue to get the current
subjectanddescription:GET /{owner}/{repo}/issues/{id} - Update the issue with
status_id=5, preserving the current description:PUT /{owner}/{repo}/issues/{id} Body: { "subject": <current subject>, "description": <current description>, "status_id": 5 }
Workflow
- Confirm with the user which issue to close (by ID).
- Execute
gitlink-cli issue +close -i {id}. - Report that the issue has been closed successfully.
[!CAUTION] This is a Write Operation -- confirm user intent before executing.