`gh skill update` help incorrectly promises to preserve locally added files
維護者通常 1 天內回覆
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 82/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- go
- 領域
- cli, documentation
研究方向
說明文字位於 pkg/cmd/skills/update/update.go 約第 98–100 行;先閱讀其中關於 --force 和 update 的說明,再檢查 pkg/cmd/skills/update/update_test.go 約第 730–780 行的更新測試所描述的行為。更新說明文字,指出套用更新會取代已安裝目錄的內容,並說明即使 upstream 版本沒有變更,--force 也會執行此操作。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
gh skill update --help says that --force refreshes locally modified skill files but “does not remove extra files added locally.” On 2.102.0, applying an update replaces all contents of the installed skill directory, deleting locally added files. This also happens during a version update without --force.
A user relying on that sentence can lose notes or scripts they added to a skill directory. The documented --force --all example describes restoring modified files without explaining that additional files are discarded.
Affected version
gh version 2.102.0 (2026-09-30)
https://github.com/cli/cli/releases/tag/v2.102.0
Steps to reproduce the behavior
dir=$(mktemp -d)
gh skill install cli/cli gh --dir "$dir"
echo notes > "$dir/gh/LOCAL-NOTES.md"
gh skill update gh --dir "$dir" --force --all
ls "$dir/gh"
A version update reproduces this without --force: install gh with --pin v2.100.0, add LOCAL-NOTES.md, then run gh skill update gh --dir "$dir" --unpin --all.
Expected vs actual behavior
Expected from the help: LOCAL-NOTES.md remains alongside the refreshed SKILL.md.
Actual: LOCAL-NOTES.md is deleted; only SKILL.md remains in this reproduction.
#13449 explicitly made stale-file removal part of an in-place update, and the update test requires a locally planted file to disappear. However, the help still promises to keep extra local files.
Please correct the help to explain that applying any update replaces the installed directory's contents with the upstream skill, discarding local modifications and additional files. The --force description should separately explain that it also applies this replacement when the upstream version has not changed.
Logs
$ gh skill update gh --dir "$dir" --force --all
1 update(s) available:
• gh (cli/cli) a4791f98 (reinstall) [v2.102.0]
Updated gh
$ ls "$dir/gh"
SKILL.md
- 主要語言
- Go
- 星號
- 46.7k
- 分支
- 9.2k
- 平均合併
- 3 天 19 小時
- 30 天內合併 PR
- 53
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cli/cli 的其他 Issue
-
agentic-workflows needs-triage
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
Help text for `gh ruleset view` and `gh search issues`/`prs` refers to flags these commands do not have可能已有人在做 @BagToad 於 2 天前認領。 未關閉needs-triage
難度 1/5 1 小時以內 新手友好度 72/100
維護者通常 1 天內回覆
-
docs: clarify gh api -f vs -F and @-file expansion in the gh skill可能已有人在做 @MatiasOlivera 於 4 天前認領。 未關閉enhancement
難度 2/5 半天 新手友好度 62/100
維護者通常 1 天內回覆
-
`gh` skill description does not tell agents when to use it, so it is skipped for tasks it covers可能已有人在做 @littfed 於 10 天前認領。 未關閉enhancement
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆
-
gh pr close --comment silently discards the comment when PR is already closed or merged可能重新可做 @bunnysayzz 於 41 天前認領,目前沒有進行中的 PR。 未關閉bug gh-pr priority-2
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
相似的 Issue
-
agent-review-finding chore
難度 2/5 1-3 小時 新手友好度 73/100
jordansmall/spindrift#5748 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
-
Resource links written as host:port without a scheme are broken可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and space可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 3 天內回覆
-
needs_triage
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 2 天內回覆