{"record":{"id":"fbb4fa18728883e9","repo":"koala73/worldmonitor","slug":"unknown-command-command-none-run-worl","errorCode":null,"errorMessage":"Unknown command: ${command || '(none)'}. Run `worldmonitor --help`.","messagePattern":"Unknown command: (.+?)\\. Run `worldmonitor --help`\\.","errorType":"exception","errorClass":"UsageError","httpStatus":null,"severity":"error","filePath":"cli/src/core.mjs","lineNumber":305,"sourceCode":"\n  if (Object.hasOwn(CURATED_COMMANDS, command)) {\n    const spec = CURATED_COMMANDS[command];\n    const args = {};\n    for (const [k, v] of Object.entries(params)) args[k] = v === true ? true : String(v);\n    spec.args.forEach((a, idx) => {\n      if (positionals[idx] !== undefined) args[a.name] = positionals[idx];\n    });\n    for (const a of spec.args) {\n      if (a.required && args[a.name] === undefined) {\n        throw new UsageError(`\\`${command}\\` needs <${a.name}>. Usage: worldmonitor ${command} <${a.name}>`);\n      }\n    }\n    return mcpPlan('tools/call', { name: spec.tool, arguments: args }, options, config, {\n      needsKey: true,\n    });\n  }\n\n  throw new UsageError(`Unknown command: ${command || '(none)'}. Run \\`worldmonitor --help\\`.`);\n}\n\nexport function formatOutput(value, options = {}) {\n  if (options.raw && typeof value === 'string') return value;\n  if (options.compact) return JSON.stringify(value);\n  return JSON.stringify(value, null, 2);\n}\n\n// Flatten an OpenAPI document into printable operation rows, optionally scoped\n// to one service (the first path segment after /api/).\nexport function summarizeSpec(spec, serviceFilter) {\n  const paths = (spec && spec.paths) || {};\n  const rows = [];\n  for (const p of Object.keys(paths).sort()) {\n    const match = p.match(/^\\/api\\/([^/]+)\\/v\\d+\\//);\n    const service = match ? match[1] : '(other)';\n    if (serviceFilter && service !== serviceFilter) continue;\n    for (const method of Object.keys(paths[p])) {","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/cli/src/core.mjs#L287-L323","documentation":"planRequest falls through every known command (health, get, tools, prompts, resources, call, and the curated set); anything else raises UsageError pointing at --help, with '(none)' shown when the command slot is empty at this branch. Exit code 2.","triggerScenarios":"Typos (helth, tool); retired command names after an upgrade; a command that only exists in a newer CLI version; invisible characters from copy-paste; flags placed where the command belongs.","commonSituations":"Scripts pinned to old command names after an upgrade; shell completion inserting the wrong token; locale/keyboard typos.","solutions":["Run `worldmonitor --help` and copy an exact command name","Check the changelog/release notes for renamed or removed commands","Update the CLI package to the latest version if the command should exist","Echo the exact argv in the failing script to expose hidden characters"],"exampleFix":"# before\n$ worldmonitor helth\n# Error: Unknown command: helth. Run `worldmonitor --help`.\n\n# after\n$ worldmonitor --help    # list valid commands, then use one exactly\n$ worldmonitor health","handlingStrategy":"validation","validationCode":"// Whitelist commands before dispatching in scripts\nconst KNOWN = new Set(['health', 'get', 'tools', 'prompts', 'resources', 'call', /* curated... */]);\nif (!KNOWN.has(command)) {\n  console.error(`Unknown command: ${command}. Valid: ${[...KNOWN].join(', ')}`);\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Parse `worldmonitor --help` in wrappers to keep the valid-command set in sync","Pin the CLI version in CI so command renames surface as review diffs, not runtime errors"],"tags":["cli","usage"],"backgroundTag":"unknown-cli-command","analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}