feat: support ssh urls in lock file#346
Open
kopfrechner wants to merge 2 commits intovercel-labs:mainfrom
Open
feat: support ssh urls in lock file#346kopfrechner wants to merge 2 commits intovercel-labs:mainfrom
kopfrechner wants to merge 2 commits intovercel-labs:mainfrom
Conversation
Currently, skills installed via SSH URLs (e.g., git@gitlab.com:owner/repo.git) are not tracked in the .skill-lock.json file because getOwnerRepo() only handles HTTP(S) URLs. This commit adds SSH URL support to getOwnerRepo(), enabling: - Lock file tracking for skills installed from private repositories via SSH - Update checking with 'npx skills check' for SSH-installed skills - Update capability with 'npx skills update' for SSH-installed skills Changes: - Added SSH URL pattern matching in getOwnerRepo() to extract owner/repo path - Supports standard SSH format: git@host:path/to/repo.git - Works with GitHub, GitLab (including subgroups), and custom Git hosts - Updated existing test to reflect new SSH URL handling behavior - Added comprehensive test coverage for various SSH URL formats Fixes issue where skills installed via SSH URLs would install successfully but not appear in .skill-lock.json, preventing update tracking.
…ands Improves UX by showing users which skills cannot be automatically checked or updated, along with the manual command to update them. Changes: - 'npx skills check' now lists skills without version hashes - Shows reason why each skill cannot be checked (e.g., "Git SSH", "Local path") - Provides exact manual update command: 'npx skills add <url> -g -y' - 'npx skills update' shows similar hints when no trackable skills found - Uses hash-based detection instead of hardcoded source types - Assumes '-g' flag since lock file only tracks global installs This helps users understand that their Git SSH/local skills are tracked but require manual updates until hash tracking is implemented for those source types.
|
@kopfrechner is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
Fixes SSH URL support for lock file tracking and improves UX for skills that cannot be automatically checked for updates. SSH URLs (e.g.,
git@gitlab.com:owner/repo.git) were already documented and supported for installation, but skills installed via SSH were not being tracked in.skill-lock.json, preventing update checking and updates.Problem
The README already documents SSH URLs as a supported installation method:
# Any git URL npx skills add git@github.com:vercel-labs/agent-skills.gitHowever,
getOwnerRepo()only handled HTTP(S) URLs, causing SSH-installed skills to:.skill-lock.jsonnpx skills checknpx skills updateAdditionally, when skills couldn't be checked for updates (Git SSH, local paths, etc.), users received no guidance on how to update them manually.
Solution
Part 1: SSH URL Tracking
getOwnerRepo()to extract the owner/repo path from SSH URLsPart 2: UX Improvements
npx skills checknow shows skills that cannot be checked automaticallynpx skills add <url> -g -ynpx skills updateshows similar hints when no trackable skills are foundChanges
getOwnerRepo()forgit@host:path/to/repo.gitformatrunCheck()to collect and display non-trackable skills with helpful hintsrunUpdate()to show manual update commands for non-trackable skillsTesting
Manual testing:
npx skills checkshows helpful hint with manual update command ✅npx skills updateshows helpful hint with manual update command ✅Unit tests:
source-parser.test.ts.git, no path, etc.)Example Output
Before:
After:
$ npx skills check No GitHub skills to check. 1 skill(s) cannot be checked automatically: • hello-world (Git SSH (hash tracking not implemented)) To update: npx skills add git@gitlab.com:hello-world/... -g -yAdditional Context
Git history shows SSH support was never intentionally excluded - the original
getOwnerRepo()implementation used a regex pattern that only matched HTTP(S) URLs (with/after.com), while SSH URLs use:(e.g.,git@github.com:owner/repo). The test "SSH format returns null" was added to document the existing behavior, not as a design decision to exclude SSH.This change enables future enhancements like GitLab API integration for update checking.