Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
skip prompting for skills without metadata when running gh skill upda…
…te --all
  • Loading branch information
tommaso-moro committed May 19, 2026
commit 55808753070c023c45b40592fbfc624d8f03a759
3 changes: 2 additions & 1 deletion pkg/cmd/skills/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func NewCmdUpdate(f *cmdutil.Factory, runF func(*UpdateOptions) error) *cobra.Co

Skills without GitHub metadata (e.g. installed manually or by another
tool) are prompted for their source repository in interactive mode.
With %[1]s--all%[1]s or in non-interactive mode, they are skipped with a notice.
The update re-downloads the skill with metadata injected, so future
updates work automatically.

Expand Down Expand Up @@ -221,7 +222,7 @@ func updateRun(opts *UpdateOptions) error {
if s.owner != "" && s.repo != "" {
continue
}
if !canPrompt {
if !canPrompt || opts.All {
noMeta = append(noMeta, s.name)
continue
}
Expand Down
36 changes: 36 additions & 0 deletions pkg/cmd/skills/update/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,42 @@ func TestUpdateRun(t *testing.T) {
},
wantStderr: "no GitHub metadata",
},
{
name: "all skips no-metadata skill without prompting",
setup: func(t *testing.T, dir string) {
t.Helper()
skillDir := filepath.Join(dir, "manual-skill")
require.NoError(t, os.MkdirAll(skillDir, 0o755))
require.NoError(t, os.WriteFile(filepath.Join(skillDir, "SKILL.md"), []byte(heredoc.Doc(`
---
name: manual-skill
---
No metadata
`)), 0o644))
},
stubs: func(reg *httpmock.Registry) {},
opts: func(ios *iostreams.IOStreams, dir string, reg *httpmock.Registry) *UpdateOptions {
ios.SetStdoutTTY(true)
ios.SetStdinTTY(true)
ios.SetStderrTTY(true)
return &UpdateOptions{
IO: ios,
Config: func() (gh.Config, error) { return config.NewBlankConfig(), nil },
HttpClient: func() (*http.Client, error) {
return &http.Client{Transport: reg}, nil
},
Prompter: &prompter.PrompterMock{
InputFunc: func(prompt string, defaultValue string) (string, error) {
return "", fmt.Errorf("unexpected prompt")
},
},
GitClient: &git.Client{RepoDir: dir},
Dir: dir,
All: true,
}
},
wantStderr: "no GitHub metadata",
},
{
name: "all up to date",
setup: func(t *testing.T, dir string) {
Expand Down