@@ -45,6 +45,11 @@ func TestNewCmdInstall(t *testing.T) {
4545 cli : "monalisa/skills-repo git-commit" ,
4646 wantOpts : InstallOptions {SkillSource : "monalisa/skills-repo" , SkillName : "git-commit" , Scope : "project" },
4747 },
48+ {
49+ name : "repo and all flag" ,
50+ cli : "monalisa/skills-repo --all" ,
51+ wantOpts : InstallOptions {SkillSource : "monalisa/skills-repo" , All : true , Scope : "project" },
52+ },
4853 {
4954 name : "all flags" ,
5055 cli : "monalisa/skills-repo git-commit --agent github-copilot --scope user --pin v1.0.0 --force" ,
@@ -77,6 +82,11 @@ func TestNewCmdInstall(t *testing.T) {
7782 cli : "monalisa/skills-repo git-commit@v1.0.0 --pin v2.0.0" ,
7883 wantErr : true ,
7984 },
85+ {
86+ name : "all conflicts with skill name" ,
87+ cli : "monalisa/skills-repo git-commit --all" ,
88+ wantErr : true ,
89+ },
8090 {
8191 name : "alias add works" ,
8292 cli : "monalisa/skills-repo git-commit" ,
@@ -171,6 +181,7 @@ func TestNewCmdInstall(t *testing.T) {
171181 assert .Equal (t , tt .wantOpts .Scope , gotOpts .Scope )
172182 assert .Equal (t , tt .wantOpts .Pin , gotOpts .Pin )
173183 assert .Equal (t , tt .wantOpts .Dir , gotOpts .Dir )
184+ assert .Equal (t , tt .wantOpts .All , gotOpts .All )
174185 assert .Equal (t , tt .wantOpts .Force , gotOpts .Force )
175186 assert .Equal (t , tt .wantOpts .FromLocal , gotOpts .FromLocal )
176187 assert .Equal (t , tt .wantOpts .AllowHiddenDirs , gotOpts .AllowHiddenDirs )
@@ -194,7 +205,7 @@ func TestNewCmdInstall(t *testing.T) {
194205 assert .NotEmpty (t , cmd .Example )
195206 assert .Contains (t , cmd .Aliases , "add" )
196207
197- for _ , flag := range []string {"agent" , "scope" , "pin" , "dir" , "force" } {
208+ for _ , flag := range []string {"agent" , "scope" , "pin" , "dir" , "all" , " force" } {
198209 assert .NotNil (t , cmd .Flags ().Lookup (flag ), "missing flag: --%s" , flag )
199210 }
200211 })
@@ -265,6 +276,14 @@ var gitCommitContent = heredoc.Doc(`
265276 # Git Commit
266277` )
267278
279+ var codeReviewContent = heredoc .Doc (`
280+ ---
281+ name: code-review
282+ description: Reviews code
283+ ---
284+ # Code Review
285+ ` )
286+
268287// singleSkillTreeJSON returns tree entries for a single skill with the given name.
269288func singleSkillTreeJSON (name , treeSHA , blobSHA string ) string {
270289 return fmt .Sprintf (
@@ -1529,6 +1548,45 @@ func TestInstallRun(t *testing.T) {
15291548 }
15301549}
15311550
1551+ func TestInstallRun_AllInstallsRemoteSkills (t * testing.T ) {
1552+ homeDir := t .TempDir ()
1553+ t .Setenv ("HOME" , homeDir )
1554+ t .Setenv ("USERPROFILE" , homeDir )
1555+
1556+ reg := & httpmock.Registry {}
1557+ defer reg .Verify (t )
1558+
1559+ stubResolveVersion (reg , "monalisa" , "skills-repo" , "v1.0.0" , "abc123" )
1560+ stubDiscoverTree (reg , "monalisa" , "skills-repo" , "abc123" ,
1561+ singleSkillTreeJSON ("code-review" , "tree-cr" , "blob-cr" )+ ", " +
1562+ singleSkillTreeJSON ("git-commit" , "tree-gc" , "blob-gc" ))
1563+ stubInstallFiles (reg , "monalisa" , "skills-repo" , "tree-cr" , "blob-cr" , codeReviewContent )
1564+ stubInstallFiles (reg , "monalisa" , "skills-repo" , "tree-gc" , "blob-gc" , gitCommitContent )
1565+
1566+ ios , _ , stdout , stderr := iostreams .Test ()
1567+ targetDir := t .TempDir ()
1568+
1569+ err := installRun (& InstallOptions {
1570+ IO : ios ,
1571+ HttpClient : func () (* http.Client , error ) { return & http.Client {Transport : reg }, nil },
1572+ GitClient : & git.Client {RepoDir : t .TempDir ()},
1573+ SkillSource : "monalisa/skills-repo" ,
1574+ All : true ,
1575+ Force : true ,
1576+ Agent : "github-copilot" ,
1577+ Scope : "project" ,
1578+ ScopeChanged : true ,
1579+ Dir : targetDir ,
1580+ Telemetry : & telemetry.NoOpService {},
1581+ })
1582+ require .NoError (t , err )
1583+ assert .Contains (t , stdout .String (), "Installed code-review" )
1584+ assert .Contains (t , stdout .String (), "Installed git-commit" )
1585+ assert .NotContains (t , stderr .String (), "must specify a skill name" )
1586+ require .FileExists (t , filepath .Join (targetDir , "code-review" , "SKILL.md" ))
1587+ require .FileExists (t , filepath .Join (targetDir , "git-commit" , "SKILL.md" ))
1588+ }
1589+
15321590func TestInstallProgress (t * testing.T ) {
15331591 ios , _ , _ , _ := iostreams .Test ()
15341592
0 commit comments