{"record":{"id":"f5b76f81bf2f0f1b","repo":"hashicorp/vault","slug":"invalid-command","errorCode":null,"errorMessage":"invalid command","messagePattern":"invalid command","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"ui/app/lib/console-helpers.ts","lineNumber":130,"sourceCode":"    } else {\n      if (path) {\n        const strippedArg = arg\n          // we'll have arg=something or arg=\"lol I need spaces\", so need to split on the first =\n          .split(/=(.+)/)\n          // if there were quotes, there's an empty string as the last member in the array that we don't want,\n          // so filter it out\n          .filter((str) => str !== '')\n          // glue the data back together\n          .join('=');\n        data.push(strippedArg);\n      } else {\n        path = arg;\n      }\n    }\n  });\n\n  if (!supportedCommands.includes(method)) {\n    throw new Error('invalid command');\n  }\n  return { method, flagArray: flags, path, dataArray: data };\n}\n\ninterface LogResponse {\n  auth?: StringMap;\n  data?: StringMap;\n  wrap_info?: StringMap;\n  [key: string]: unknown;\n}\n\nexport function logFromResponse(response: LogResponse, path: string, method: string, flags: Flags) {\n  const { format, field } = flags;\n  const respData: StringMap | undefined = response && (response.auth || response.data || response.wrap_info);\n  const secret: StringMap | LogResponse = respData || response;\n\n  if (!respData) {\n    if (method === 'write') {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/hashicorp/vault/blob/744b611b5700b3b7f82d76b4d6938a91b9989367/ui/app/lib/console-helpers.ts#L112-L148","documentation":"Thrown by the Vault UI's embedded console parser (ui/app/lib/console-helpers.ts:130). parseCommand() tokenizes the typed command, takes the first token as the method, and only read, write, list, delete, and kv-get are supported HTTP-style commands (UI-only commands like api, clear, clearall, fullscreen, refresh are handled separately by executeUICommand). Any other leading token throws 'invalid command'.","triggerScenarios":"Typing a vault CLI command whose verb is not in supportedCommands — e.g. vault status, vault operator init, vault secrets enable, vault audit enable, or a typo like readd — into the UI console.","commonSituations":"Users assume the web console has full parity with the vault CLI and paste arbitrary CLI commands; automation scripts or tutorials written for the CLI are copy-pasted into the console.","solutions":["Use one of the supported verbs: read, write, list, delete, or kv-get (e.g. vault list secret/metadata, vault kv-get secret/foo)","Perform administrative operations (status, enable, unseal, audit) with the real vault CLI or against the HTTP API"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED = ['read', 'write', 'list', 'delete', 'kv-get'];\nconst [verb] = input.trim().split(/\\s+/);\nif (!SUPPORTED.includes(verb)) {\n  showConsoleHelp(`Supported commands: ${SUPPORTED.join(', ')}. Other operations require the vault CLI.`);\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const { method, path, flagArray, dataArray } = parseCommand(command);\n} catch (e) {\n  if (e.message === 'invalid command') {\n    logToConsole(`invalid command — supported: read, write, list, delete, kv-get`);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Treat the embedded console as an API shortcut (read/write/list/delete/kv-get), not a CLI replacement","Prefix commands with vault or not — both parse, but the verb still must be one of the five"],"tags":["console","cli","parsing","unsupported-command"],"backgroundTag":null,"analyzedSha":"744b611b5700b3b7f82d76b4d6938a91b9989367","analyzedAt":"2026-08-15T14:40:29.333Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}