MCPcopy Create free account
hub / github.com/compozy/agh / newSkillRemoveCommand

Function newSkillRemoveCommand

internal/cli/skill_commands.go:534–558  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

532}
533
534func newSkillRemoveCommand(deps commandDeps) *cobra.Command {
535 return &cobra.Command{
536 Use: "remove <name>",
537 Short: "Remove an installed marketplace skill",
538 Example: ` # Remove a marketplace-installed skill by local name
539 agh skill remove code-review`,
540 Args: exactOneNonBlankArg(),
541 RunE: func(cmd *cobra.Command, args []string) error {
542 name, err := normalizeSkillName(args[0])
543 if err != nil {
544 return err
545 }
546
547 item, err := removeMarketplaceSkillForCommand(cmd.Context(), deps, name)
548 if err != nil {
549 if bundledSkillExists(name) {
550 return fmt.Errorf("skill %q is not a marketplace-installed skill", name)
551 }
552 return err
553 }
554
555 return writeCommandOutput(cmd, skillRemoveBundle(item))
556 },
557 }
558}
559
560func bundledSkillExists(name string) bool {
561 _, err := skillbundled.LoadContent(name)

Callers 1

newSkillCommandFunction · 0.85

Calls 6

exactOneNonBlankArgFunction · 0.85
normalizeSkillNameFunction · 0.85
bundledSkillExistsFunction · 0.85
writeCommandOutputFunction · 0.85
skillRemoveBundleFunction · 0.85

Tested by

no test coverage detected