(deps commandDeps)
| 506 | } |
| 507 | |
| 508 | func newSkillInstallCommand(deps commandDeps) *cobra.Command { |
| 509 | version := "" |
| 510 | cmd := &cobra.Command{ |
| 511 | Use: "install <slug>", |
| 512 | Short: "Install a marketplace skill", |
| 513 | Example: ` # Install the latest marketplace version of a skill |
| 514 | agh skill install @acme/code-review`, |
| 515 | Args: exactOneNonBlankArg(), |
| 516 | RunE: func(cmd *cobra.Command, args []string) error { |
| 517 | slug, err := normalizeSkillSlug(args[0]) |
| 518 | if err != nil { |
| 519 | return err |
| 520 | } |
| 521 | |
| 522 | item, err := installMarketplaceSkillForCommand(cmd.Context(), deps, slug, version) |
| 523 | if err != nil { |
| 524 | return err |
| 525 | } |
| 526 | |
| 527 | return writeCommandOutput(cmd, skillInstallBundle(item)) |
| 528 | }, |
| 529 | } |
| 530 | cmd.Flags().StringVar(&version, "version", "", "Marketplace version to install") |
| 531 | return cmd |
| 532 | } |
| 533 | |
| 534 | func newSkillRemoveCommand(deps commandDeps) *cobra.Command { |
| 535 | return &cobra.Command{ |
no test coverage detected