sipeed/picoclaw · warning

when --registry is set, exactly 1 argument is required: <slu

Error message

when --registry is set, exactly 1 argument is required: <slug>

What it means

Cobra Args validator for `picoclaw skills install`: when --registry is set, exactly one positional argument (the registry slug) must follow. Passing zero arguments or more than one together with --registry produces this usage error before RunE executes.

Source

Thrown at cmd/picoclaw/internal/skills/install.go:24

	"github.com/spf13/cobra"

	"github.com/sipeed/picoclaw/cmd/picoclaw/internal"
)

func newInstallCommand() *cobra.Command {
	var registry string

	cmd := &cobra.Command{
		Use:   "install",
		Short: "Install skill from GitHub or a registry",
		Example: `
picoclaw skills install sipeed/picoclaw-skills/weather
picoclaw skills install --registry clawhub github
`,
		Args: func(cmd *cobra.Command, args []string) error {
			if registry != "" {
				if len(args) != 1 {
					return fmt.Errorf("when --registry is set, exactly 1 argument is required: <slug>")
				}
				return nil
			}

			if len(args) != 1 {
				return fmt.Errorf("exactly 1 argument is required: <github>")
			}

			return nil
		},
		RunE: func(_ *cobra.Command, args []string) error {
			cfg, err := internal.LoadConfig()
			if err != nil {
				return err
			}
			if registry != "" {
				return skillsInstallFromRegistry(cfg, registry, args[0])
			}

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Supply exactly one slug: `picoclaw skills install --registry clawhub github`
  2. Quote slugs containing spaces or special characters as one argument
  3. In scripts, pass the slug explicitly rather than "$@"

Example fix

# before
picoclaw skills install --registry clawhub

# after
picoclaw skills install --registry clawhub github
Defensive patterns

Strategy: validation

Validate before calling

if registry != "" && len(args) != 1 {
    return fmt.Errorf("usage: picoclaw skills install --registry <name> <slug>")
}

Prevention

When it happens

Trigger: `picoclaw skills install --registry clawhub` (no slug), `picoclaw skills install --registry clawhub weather extra` (two args), or quoting mistakes that split one slug into several words.

Common situations: Assuming --registry alone lists or initializes registries; passing a URL with spaces unquoted; scripts forwarding "$@" where extra flags land as positional args.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/9d4b36ff02037d7b. Report an issue: GitHub.