Add git:<url> as a third install source#1
Open
tianyilt wants to merge 2 commits into
Open
Conversation
/skill-git:install now accepts git:<owner>/<repo> shorthand or git:<full-url> in addition to skillhub: and clawhub: identifiers. An optional @<install_name> suffix overrides the auto-derived name. Cloned .git is preserved so sg-init.sh re-tags idempotently and `git pull` works for upstream updates later. This unlocks installing skills from private repos (GitHub, GitLab, self-hosted) and any git host beyond the two public registries. - commands/install.md: parse git:<spec>, add Step 3c "Git URL" - scripts/sg-install-git.sh: new helper, normalizes shorthand to git@github.com, refuses non-empty targets, validates SKILL.md presence Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
HTTPS works for public repos with no setup and for private repos when the user has run `gh auth login` (gh registers a credential helper). Requiring SSH out of the box would block users who haven't uploaded an SSH public key to GitHub. SSH remains available via the full URL form (git:git@github.com:owner/repo.git). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Author
|
思路就是类比npm pip install这样 支持对着github装库 因为有些skill还在开发或者私仓阶段 就和yml里面git+一样 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
git:<url>as a third install source for/skill-git:install, alongside the existingskillhub:andclawhub:registries. Lets users install skills from any git URL — including private repos on GitHub/GitLab/self-hosted, beyond what the two public registries cover.Motivation
/skill-git:installcurrently only accepts SkillHub or ClawHub identifiers. Both registries serve public skills. Users who:…have no first-class path. The vim-plug / npm / pip ecosystem has long settled on "any git URL" as the universal source — this PR brings the same convenience to skill-git, completing the pattern alongside the curated public registries.
Design
<owner>/<repo>shorthand expands tohttps://github.com/<owner>/<repo>.git. HTTPS works for public repos with no setup, and for private repos when the user has rungh auth login(gh registers a git credential helper). Users who prefer SSH can pass the full URL:git:git@github.com:owner/repo.git.git cloneas-is (https://,http://,git@host:,ssh://).@<install_name>overrides the auto-derived name (basename of the repo with.gitstripped). Useful when the repo is namedskill-foobut the user wants to install it asfoo..gitand tags are preserved (not stripped).sg-init.shalready handles 4 cases — including "repo with existingv*tags" (Case D, skip) and "repo with commits but no tags" (Case C, tag v1.0.0 on the first commit) — so the existing init step composes cleanly with cloned content.git pull originworks for upstream updates afterward.Implementation
commands/install.mddescription/argument-hintupdated. Step 0 addsgit:<spec>parsing + install_name derivation. Step 3 adds new sub-section3c. Git URL; existing "Validate" renumbered to3d. Preview Source line includesGit — <url>.scripts/sg-install-git.shgit clone, validatesSKILL.mdpresence at repo root.Total diff: +88 / -6 lines, 1 new file.
Tests
Manual reproduction (
scripts/sg-install-git.shdirectly, since the repo has no test harness):.gitandv*tags ✓tianyilt/skill-paper-write→https://github.com/tianyilt/skill-paper-write.git✓Backward compatibility
SkillHub and ClawHub paths are completely untouched. Existing identifiers (
skillhub:owner/repo@skill,clawhub:slug) continue to dispatch to Steps 3a / 3b unchanged.Out of scope (potential follow-ups)
/skill-git:search git:<query>— searching arbitrary git hosts is non-trivial and not symmetric with the curated registries; left for a separate discussion.--branch/--refflag for installing a specific branch or tag — easy to add later if there's demand.