{"record":{"id":"1f4c71ea7d34be40","repo":"sipeed/picoclaw","slug":"exactly-1-argument-is-required-github","errorCode":null,"errorMessage":"exactly 1 argument is required: <github>","messagePattern":"exactly 1 argument is required: <github>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/picoclaw/internal/skills/install.go","lineNumber":30,"sourceCode":"\tvar registry string\n\n\tcmd := &cobra.Command{\n\t\tUse:   \"install\",\n\t\tShort: \"Install skill from GitHub or a registry\",\n\t\tExample: `\npicoclaw skills install sipeed/picoclaw-skills/weather\npicoclaw skills install --registry clawhub github\n`,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tif registry != \"\" {\n\t\t\t\tif len(args) != 1 {\n\t\t\t\t\treturn fmt.Errorf(\"when --registry is set, exactly 1 argument is required: <slug>\")\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"exactly 1 argument is required: <github>\")\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tcfg, err := internal.LoadConfig()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif registry != \"\" {\n\t\t\t\treturn skillsInstallFromRegistry(cfg, registry, args[0])\n\t\t\t}\n\n\t\t\treturn skillsInstallFromRegistry(cfg, \"github\", args[0])\n\t\t},\n\t}\n\n\tcmd.Flags().StringVar(&registry, \"registry\", \"\", \"Install from registry: --registry <name> <slug>\")","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/skills/install.go#L12-L48","documentation":"Cobra Args validator for `picoclaw skills install` without --registry: exactly one positional argument (a GitHub owner/repo/path reference) is required. Any other arity is rejected before the command runs.","triggerScenarios":"`picoclaw skills install` with no arguments, or with two or more arguments such as `picoclaw skills install sipeed/picoclaw-skills/weather extra`.","commonSituations":"Forgetting the skill path; trying to install several skills in one invocation (not supported); unquoted paths splitting into multiple shell words.","solutions":["Pass exactly one GitHub reference: `picoclaw skills install sipeed/picoclaw-skills/weather`","Install multiple skills by invoking the command once per skill","Quote the whole owner/repo/skill argument so the shell delivers one word"],"exampleFix":"# before\npicoclaw skills install weather news\n\n# after\npicoclaw skills install sipeed/picoclaw-skills/weather\npicoclaw skills install sipeed/picoclaw-skills/news","handlingStrategy":"validation","validationCode":"if registry == \"\" && len(args) != 1 {\n    return fmt.Errorf(\"usage: picoclaw skills install <owner/repo/skill>\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One install per command invocation","Validate owner/repo/skill shape before shelling out","Quote full GitHub references"],"tags":["cli","argument-validation","skills","usage"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}