Skip to content

Commit 2570796

Browse files
committed
fix: panic in install and missing uninstall alias
1 parent b7a9e9a commit 2570796

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- **Local Install Optimization**: Installing a skill that exists in the local cache now performs a fast file copy instead of a git clone.
1616
- **Testing**: Added comprehensive unit tests for CLI commands.
1717

18+
### Fixed
19+
- **Panic on Single-Word Install**: Fixed critical panic when using `ask install <name>` with a single word argument.
20+
- **Uninstall Alias**: Added missing top-level `ask uninstall` alias (previously only `ask skill uninstall` worked).
21+
1822
### Changed
1923
- **Repository Naming**: Local cache directories now use the user-configured repository name (e.g. `anthropics`).
2024
- **Improved UX**: Reduced verbosity of installation commands.

cmd/install.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ func installSingleSkill(input string, global bool, agents []string, cfg *config.
261261
subDir = strings.Join(parts[2:], "/")
262262
skillName = parts[len(parts)-1]
263263
repoURL = fmt.Sprintf("https://github.com/%s/%s.git", owner, repo)
264-
} else {
264+
} else if len(parts) >= 2 {
265265
// Potential RepoName/SkillName from cache (e.g. "anthropics-skills/browser-use")
266266
// or Standard install: owner/repo (e.g. "browser-use/browser-use")
267267

268268
foundInCache := false
269+
269270
repoName := parts[0]
270271
skillNamePart := parts[1]
271272

@@ -333,6 +334,7 @@ func installSingleSkill(input string, global bool, agents []string, cfg *config.
333334
}
334335
}
335336
}
337+
336338
}
337339

338340
if !foundInCache {

cmd/root.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ var listRootCmd = &cobra.Command{
7575
Run: runList,
7676
}
7777

78+
var uninstallRootCmd = &cobra.Command{
79+
Use: "uninstall [skill-name]",
80+
Short: "Uninstall a skill (alias for 'skill uninstall')",
81+
Long: "Remove a skill from the skills directory.\nThis is a shortcut for 'ask skill uninstall'.",
82+
Example: uninstallCmd.Example,
83+
Args: uninstallCmd.Args,
84+
Run: uninstallCmd.Run,
85+
}
86+
7887
// Execute adds all child commands to the root command and sets flags appropriately.
7988
// This is called by main.main(). It only needs to happen once to the rootCmd.
8089
func Execute() {
@@ -107,6 +116,15 @@ func init() {
107116

108117
rootCmd.AddCommand(listRootCmd)
109118
registerListFlags(listRootCmd)
119+
120+
rootCmd.AddCommand(uninstallRootCmd)
121+
// No specific flags to register for uninstall root shim as it uses uninstallCmd.Run directly?
122+
// Actually uninstallCmd.Run uses flags so we should share flags definition or re-register.
123+
// Since uninstallCmd is in another file, we can't easily reuse 'registerUninstallFlags' unless we export it.
124+
// But uninstallCmd is exported. Let's see how registerListFlags works.
125+
// It's likely defined in list.go.
126+
// We should probably just copy flags setup here.
127+
uninstallRootCmd.Flags().AddFlagSet(uninstallCmd.Flags())
110128
}
111129

112130
// initConfig reads in config file and ENV variables if set.

0 commit comments

Comments
 (0)