{"record":{"id":"a07cd1e98a76a7e2","repo":"kgretzky/evilginx2","slug":"command-not-found","errorCode":null,"errorMessage":"command not found","messagePattern":"command not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"core/help.go","lineNumber":124,"sourceCode":"\t\t\t\tpcmd := cmd\n\t\t\t\tif layer&h.cmd_layers[cmd] != 0 {\n\t\t\t\t\tpcmd = lb.Sprint(cmd)\n\t\t\t\t}\n\t\t\t\tline_help, _ := h.line_help[cmd]\n\t\t\t\trows = append(rows, pcmd)\n\t\t\t\tvals = append(vals, line_help)\n\t\t\t}\n\t\t\tout += AsRows(rows, vals)\n\t\t}\n\t}\n\tlog.Printf(\"\\n%s\\n\", out)\n}\n\nfunc (h *Help) PrintBrief(cmd string) error {\n\tyw := color.New(color.FgYellow)\n\tvar out string\n\tif _, ok := h.line_help[cmd]; !ok {\n\t\treturn fmt.Errorf(\"command not found\")\n\t}\n\tout += fmt.Sprintf(\" %s\\n\\n\", yw.Sprint(cmd))\n\tif cmd_info, ok := h.cmd_infos[cmd]; ok {\n\t\tif len(cmd_info) > 0 {\n\t\t\tmax_line := 64\n\t\t\tn_line := 0\n\t\t\tvar out_info []rune\n\t\t\tout_info = append(out_info, ' ')\n\t\t\tr_info := []rune(cmd_info)\n\t\t\tfor _, r := range r_info {\n\t\t\t\tif r == ' ' && n_line > max_line {\n\t\t\t\t\tout_info = append(out_info, '\\n')\n\t\t\t\t\tn_line = 0\n\t\t\t\t} else if r == '\\n' {\n\t\t\t\t\tout_info = append(out_info, '\\n')\n\t\t\t\t\tout_info = append(out_info, ' ')\n\t\t\t\t\tn_line = 0\n\t\t\t\t\tcontinue","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/help.go#L106-L142","documentation":"PrintBrief in core/help.go returns this when asked to print brief help for a command name that does not exist in the Help registry (h.line_help). The registry is populated from registered console commands, so the lookup key must exactly match a registered command. It is a guard against unknown command names passed to the help printer.","triggerScenarios":"Calling h.PrintBrief(cmd) (directly or via DoWork handling a console command like 'help <cmd>' or 'help <cmd> <sub>') with a string that is not a key in h.line_help — e.g. a typo'd command, an unregistered subcommand, or a command from a different version of evilginx.","commonSituations":"Typing 'help proxys' instead of 'proxy', asking help for a subcommand that doesn't exist on this command, or help invoked for a command removed/renamed between evilginx versions.","solutions":["Check the exact command name with plain `help` (no arguments) to list available commands","Fix the spelling or casing of the command passed to PrintBrief / the help command","Verify the command is actually registered before calling PrintBrief","If scripting, enumerate valid commands first instead of guessing names"],"exampleFix":"// before\nh.PrintBrief(\"proxys\")\n// after\nh.PrintBrief(\"proxy\") // exact registered command name","handlingStrategy":"validation","validationCode":"if _, ok := h.line_help[cmd]; !ok {\n    return fmt.Errorf(\"unknown command: %s\", cmd) // check registry before printing\n}","typeGuard":"func commandExists(h *Help, cmd string) bool {\n    _, ok := h.line_help[cmd]\n    return ok\n}","tryCatchPattern":"if err := h.PrintBrief(cmd); err != nil {\n    if strings.Contains(err.Error(), \"command not found\") {\n        log.Warn(\"no help for %q; run 'help' to list commands\", cmd)\n    }\n}","preventionTips":["Always list available commands with plain `help` before querying help for a specific one","Validate command names against the registry before calling PrintBrief","Add a command-name autocompletion/tab-completion step in interactive flows"],"tags":["cli","command-not-found","help"],"backgroundTag":"unknown-command","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}