Uninstall removes an installed skill. Supports both exact names ("anthropics-skills--frontend-design") and base names ("frontend-design"). When multiple installs match a base name, lists them and asks the user to specify which one to remove.
(name string)
| 459 | // base names ("frontend-design"). When multiple installs match a base name, |
| 460 | // lists them and asks the user to specify which one to remove. |
| 461 | func (sh *SkillHandler) Uninstall(name string) { |
| 462 | // Try exact name first |
| 463 | if sh.registryMgr.IsInstalled(name) { |
| 464 | sh.doUninstall(name) |
| 465 | return |
| 466 | } |
| 467 | |
| 468 | // Try base name lookup |
| 469 | matches := sh.registryMgr.GetAllInstalledInfo(name) |
| 470 | if len(matches) == 0 { |
| 471 | fmt.Printf("\n %s\n\n", i18n.T("skill.uninstall.not_installed", name)) |
| 472 | return |
| 473 | } |
| 474 | |
| 475 | if len(matches) == 1 { |
| 476 | // Single match — uninstall it |
| 477 | sh.doUninstall(matches[0].Name) |
| 478 | return |
| 479 | } |
| 480 | |
| 481 | // Multiple matches — ask user to specify |
| 482 | fmt.Printf("\n %s %q %s:\n\n", |
| 483 | i18n.T("skill.uninstall.multiple"), |
| 484 | name, |
| 485 | i18n.T("skill.uninstall.specify")) |
| 486 | for i, m := range matches { |
| 487 | fmt.Printf(" %d. %s %s\n", i+1, |
| 488 | colorize(m.Name, ColorCyan), |
| 489 | colorize(fmt.Sprintf("[%s]", m.Source), ColorGray)) |
| 490 | } |
| 491 | fmt.Printf("\n %s\n\n", |
| 492 | i18n.T("skill.uninstall.use_full_name")) |
| 493 | } |
| 494 | |
| 495 | func (sh *SkillHandler) doUninstall(name string) { |
| 496 | fmt.Printf("\n %s %s...\n", i18n.T("skill.uninstall.removing"), colorize(name, ColorCyan)) |
no test coverage detected