{"record":{"id":"df7ddf5e020ecacb","repo":"affaan-m/ECC","slug":"catalog-show-requires-an-install-component-id","errorCode":null,"errorMessage":"Catalog show requires an install component ID","messagePattern":"Catalog show requires an install component ID","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/catalog.js","lineNumber":168,"sourceCode":"      return;\n    }\n\n    if (options.command === 'components') {\n      const components = listInstallComponents({\n        family: options.family,\n        target: options.target,\n      });\n      if (options.json) {\n        console.log(JSON.stringify({ components }, null, 2));\n      } else {\n        printComponents(components);\n      }\n      return;\n    }\n\n    if (options.command === 'show') {\n      if (!options.componentId) {\n        throw new Error('Catalog show requires an install component ID');\n      }\n      const component = getInstallComponent(options.componentId);\n      if (options.json) {\n        console.log(JSON.stringify(component, null, 2));\n      } else {\n        printComponent(component);\n      }\n      return;\n    }\n\n    throw new Error(`Unknown catalog command: ${options.command}`);\n  } catch (error) {\n    console.error(`Error: ${error.message}`);\n    process.exit(1);\n  }\n}\n\nmain();","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/catalog.js#L150-L186","documentation":"In main(), the `show` command is only meaningful with a component ID: getInstallComponent needs an install component identifier to look up. If options.command is 'show' with no componentId, main throws 'Catalog show requires an install component ID' as a command-level guard.","triggerScenarios":"`node scripts/catalog.js show` with no positional ID; invoking show programmatically via options {command:'show'} without componentId; dynamic arg builders dropping an empty ID variable.","commonSituations":"Users forgetting the ID argument; scripts building CLI args dynamically and dropping an unset variable; IDE run configurations with missing program arguments.","solutions":["Provide the ID: `node scripts/catalog.js show <install-component-id>`","Find valid IDs with `node scripts/catalog.js list` (or the JSON variant)","Check the dynamic script that builds the command for an unset ID variable","Use the catalog registry/docs to confirm the exact component identifier"],"exampleFix":"// before\nnode scripts/catalog.js show\n// Error: Catalog show requires an install component ID\n// after\nnode scripts/catalog.js show code-reviewer","handlingStrategy":"validation","validationCode":"if (process.argv[2] === 'show' && !process.argv[3]) {\n  console.error('Usage: catalog show <componentId>');\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":"try {\n  main();\n} catch (err) {\n  if (err.message === 'Catalog show requires an install component ID') {\n    console.error('Usage: catalog show <install-component-id>');\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Always pass the component ID when calling show","List available IDs first with 'catalog list'","Check dynamically generated commands for empty ID variables","Add the ID as a required parameter in wrapper scripts"],"tags":["cli","missing-argument","catalog"],"backgroundTag":"missing-cli-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}