{"record":{"id":"a66e20468a9e6c13","repo":"glanceapp/glance","slug":"unknown-command-s","errorCode":null,"errorMessage":"unknown command: %s","messagePattern":"unknown command: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/cli.go","lineNumber":68,"sourceCode":"\t\tfmt.Println(\"\\nCommands:\")\n\t\tfmt.Println(\"  config:validate       Validate the config file\")\n\t\tfmt.Println(\"  config:print          Print the parsed config file with embedded includes\")\n\t\tfmt.Println(\"  password:hash <pwd>   Hash a password\")\n\t\tfmt.Println(\"  secret:make           Generate a random secret key\")\n\t\tfmt.Println(\"  sensors:print         List all sensors\")\n\t\tfmt.Println(\"  mountpoint:info       Print information about a given mountpoint path\")\n\t\tfmt.Println(\"  diagnose              Run diagnostic checks\")\n\t}\n\n\tconfigPath := flags.String(\"config\", \"glance.yml\", \"Set config path\")\n\terr := flags.Parse(os.Args[1:])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar intent cliIntent\n\targs = flags.Args()\n\tunknownCommandErr := fmt.Errorf(\"unknown command: %s\", strings.Join(args, \" \"))\n\n\tif len(args) == 0 {\n\t\tintent = cliIntentServe\n\t} else if len(args) == 1 {\n\t\tif args[0] == \"config:validate\" {\n\t\t\tintent = cliIntentConfigValidate\n\t\t} else if args[0] == \"config:print\" {\n\t\t\tintent = cliIntentConfigPrint\n\t\t} else if args[0] == \"sensors:print\" {\n\t\t\tintent = cliIntentSensorsPrint\n\t\t} else if args[0] == \"diagnose\" {\n\t\t\tintent = cliIntentDiagnose\n\t\t} else if args[0] == \"secret:make\" {\n\t\t\tintent = cliIntentSecretMake\n\t\t} else {\n\t\t\treturn nil, unknownCommandErr\n\t\t}\n\t} else if len(args) == 2 {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/cli.go#L50-L86","documentation":"Returned by the CLI arg parser in internal/glance/cli.go when the positional arguments after flag parsing do not match any known subcommand (config:validate, config:print, sensors:print, diagnose, mountpoint:info variants) and are not a single file path (serve intent). The error message joins all remaining args with spaces, e.g. `unknown command: servre`.","triggerScenarios":"Running `glance servre`, `glance check config`, `glance --config glance.yml frobnicate`, or passing multiple unexpected positionals. Also when flags come after the subcommand in a way flag.Parse leaves unexpected Args behind.","commonSituations":"Typos in subcommands (`validate` instead of `config:validate`); assuming CLI verbs that don't exist; old scripts written against different tooling; copy-pasting commands from outdated docs.","solutions":["Run `glance --help` (or glance with no args) and use one of the listed commands: config:validate, config:print, sensors:print, diagnose, mountpoint:info.","For config checking use `glance config:validate --config glance.yml`.","Fix typos: the command is `config:validate`, not `validate` or `check`.","If you intended to serve a file, pass just the config path as the single positional argument."],"exampleFix":"# before\n$ glance validate --config glance.yml\n\n# after\n$ glance config:validate --config glance.yml","handlingStrategy":"validation","validationCode":"# shell: reject before running\ncase \"$1\" in\n  \"\"|config:validate|config:print|sensors:print|diagnose|mountpoint:info) glance \"$@\" ;;\n  *) echo \"unknown command: $1\"; glance --help; exit 1 ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `glance --help` first; commands are config:validate, config:print, sensors:print, diagnose, mountpoint:info.","Wrap glance invocations in scripts that verify subcommands before deploy."],"tags":["cli","usage","arguments"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}