{"record":{"id":"f6c1c325c397e724","repo":"chatboxai/chatbox","slug":"missing-setting-key","errorCode":null,"errorMessage":"Missing setting key.","messagePattern":"Missing setting key\\.","errorType":"validation","errorClass":"ChatboxCliUsageError","httpStatus":null,"severity":"warning","filePath":"src/renderer/packages/chatbox-cli/settings.ts","lineNumber":144,"sourceCode":"      return {\n        readOnly: true,\n        changeGuidance: 'Guide the user to the listed Chatbox Settings page to make changes manually.',\n        settings: safeSettings.map((setting) => ({\n          key: setting.key,\n          value: setting.read(),\n          description: setting.description,\n          location: `Settings > ${setting.page}`,\n        })),\n      }\n    },\n  },\n  {\n    path: ['settings', 'get'],\n    description: 'Read one allowlisted setting.',\n    usage: 'chatbox settings get <key>',\n    execute({ parsed }) {\n      const key = parsed.positionals[0]\n      if (!key) throw new ChatboxCliUsageError('Missing setting key.')\n      const setting = findSetting(key)\n      return {\n        readOnly: true,\n        key,\n        value: setting.read(),\n        description: setting.description,\n        location: `Settings > ${setting.page}`,\n        changeGuidance: manualChangeGuidance(setting.page),\n      }\n    },\n  },\n]\n","sourceCodeStart":126,"sourceCodeEnd":157,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/chatbox-cli/settings.ts#L126-L157","documentation":"Thrown by the `settings get` command handler when no positional argument is supplied, i.e. parsed.positionals[0] is falsy. The command requires exactly one key argument, so an empty invocation is treated as a usage error rather than a no-op.","triggerScenarios":"Running `chatbox settings get` with no trailing key argument. The guard is `const key = parsed.positionals[0]; if (!key) throw ...`.","commonSituations":"User forgets the key; a wrapper script invokes the command with an empty/unset variable; user runs the bare command expecting a list.","solutions":["Supply a key: `chatbox settings get <key>`.","Run `chatbox settings list` first to discover valid keys.","If scripting, guard against the empty-variable case before invoking the command."],"exampleFix":"// before\nchatbox settings get\n\n// after\nchatbox settings get app.startup-page","handlingStrategy":"validation","validationCode":"const key = parsed.positionals[0]\nif (!key) {\n  // print usage and exit 2 instead of calling the handler\n  console.error('Usage: chatbox settings get <key>')\n  process.exit(2)\n}","typeGuard":"function hasPositional(pos: unknown): pos is string {\n  return typeof pos === 'string' && pos.length > 0\n}","tryCatchPattern":"try {\n  // handler throws if missing\n} catch (e) {\n  if (e instanceof ChatboxCliUsageError && e.message === 'Missing setting key.') {\n    // render input prompt for the key\n  }\n}","preventionTips":["Validate required positionals in the arg-parsing layer before dispatch.","Provide shell completion for known keys.","In scripts, assert the env var is non-empty before substitution."],"tags":["cli","validation","user-input","settings"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}