{"record":{"id":"8a376dd9f047120a","repo":"derailed/k9s","slug":"s-command-not-found","errorCode":null,"errorMessage":"`%s` command not found","messagePattern":"`(.+?)` command not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/view/command.go","lineNumber":321,"sourceCode":"\t\tif a, ok := p.DirArg(); !ok {\n\t\t\tc.app.Flash().Errf(\"Invalid command. Use `dir xxx`\")\n\t\t} else if err := c.app.dirCmd(a, pushCmd); err != nil {\n\t\t\tc.app.Flash().Err(err)\n\t\t}\n\tdefault:\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (c *Command) viewMetaFor(p *cmd.Interpreter) (*client.GVR, *MetaViewer, *cmd.Interpreter, error) {\n\tif c.alias == nil {\n\t\treturn client.NoGVR, nil, nil, fmt.Errorf(\"no connection available\")\n\t}\n\tgvr, ok := c.alias.Resolve(p)\n\tif !ok {\n\t\treturn client.NoGVR, nil, nil, fmt.Errorf(\"`%s` command not found\", p.Cmd())\n\t}\n\n\tv := MetaViewer{\n\t\tviewerFn: func(gvr *client.GVR) ResourceViewer {\n\t\t\treturn NewScaleExtender(NewOwnerExtender(NewBrowser(gvr)))\n\t\t},\n\t}\n\tif mv, ok := customViewers[gvr]; ok {\n\t\tv = mv\n\t}\n\n\treturn gvr, &v, p, nil\n}\n\nfunc (*Command) componentFor(gvr *client.GVR, fqn string, v *MetaViewer) ResourceViewer {\n\tvar view ResourceViewer\n\tif v.viewerFn != nil {\n\t\tview = v.viewerFn(gvr)","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/command.go#L303-L339","documentation":"The alias resolver rejected the command token p.Cmd(): it matches neither a resource short/full name, a configured alias, nor a built-in command. The app uses aliases as its command vocabulary, so an unresolvable token cannot be mapped to a viewer.","triggerScenarios":"Typing :pod instead of :po, :ingress vs :ing mismatches, :mycustomcmd with no alias defined; tokens that exist as kubectl names but not as app aliases; stale command history replayed after aliases were removed from config.","commonSituations":"New users guessing command names; aliases customized per cluster/user config; upgrades renaming/removing aliases; deleted aliases still present in cmdHistory.","solutions":["Use canonical short names: po, svc, dp, ds, sts, rs, ing, cm, ns, and built-ins like ctx, xray, alias.","List/define aliases: open the alias view or add entries under the aliases section of the config.","If the command came from history, clear/ignore it after alias changes."],"exampleFix":"# before\n:pod\n\n# after\n:po","handlingStrategy":"validation","validationCode":"if _, ok := c.alias.Resolve(p); !ok {\n    return fmt.Errorf(\"unknown command %q — check aliases with the alias view\", p.Cmd())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Learn canonical aliases (po, svc, dp, ds, sts, rs, ing, ns, ctx).","After editing alias config, restart or reload so the resolver picks it up.","Avoid replaying old history entries after removing an alias."],"tags":["alias","command","usage","navigation"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}