-
Notifications
You must be signed in to change notification settings - Fork 469
feat(cli): add --scope option to install command #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f7ab8f4
feat(cli): add --scope option to install command
dongmucat 96681b0
fix(cli): label scope by userRoots membership instead of cwd prefix
dongmucat c6fa37b
Merge branch 'main' into feat/cli-install-scope
dongmucat 8c8b047
docs(protocol): adopt .agents/skills (plural) as canonical universal …
dongmucat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在
resolveInstallTargets中,当options.home未定义时,detectAll被传入了空字符串''。这会导致detectAll无法正确探测到用户目录(home directory)下的 Agent 技能目录(例如~/.claude/skills),因为userRoots('')会生成错误的路径(如/.claude/skills)。建议统一使用homedir()作为默认值,这与同一文件中的其他逻辑(如第 37 行和第 59 行)保持一致。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不采纳此建议。这里
detectAll使用options.home ?? ''是有意保留的兼容性行为,不是 bug:installCommand调用 resolver 时不传home,沿用options.home ?? '',意味着裸skillhub install foo(无任何参数)的非交互模式只探测 cwd 下的 agent 目录,无候选时 fallback 到<cwd>/.agents/skills。这是 PR 之前的现有行为。?? homedir(),会让裸install同时探测用户级目录(如~/.codex/skills),可能从"无候选 fallback"变成"探测到 user 候选直接安装"或"多候选报错",破坏现有非交互用户脚本。--scope路径才使用真实homedir()(见 resolver.ts:62scopedHome = options.home ?? homedir()),而scope === undefined路径完全保持现状。resolveExplicitAgents沿用options.home ?? homedir()也是 PR 之前的现有行为,不是本 PR 引入。建议保留当前实现。