affaan-m/ECC · error · Error

Catalog show requires an install component ID

Error message

Catalog show requires an install component ID

What it means

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.

Solutions

  1. Provide the ID: `node scripts/catalog.js show <install-component-id>`
  2. Find valid IDs with `node scripts/catalog.js list` (or the JSON variant)
  3. Check the dynamic script that builds the command for an unset ID variable
  4. Use the catalog registry/docs to confirm the exact component identifier

Example fix

// before
node scripts/catalog.js show
// Error: Catalog show requires an install component ID
// after
node scripts/catalog.js show code-reviewer
Defensive patterns

Strategy: validation

Validate before calling

if (process.argv[2] === 'show' && !process.argv[3]) {
  console.error('Usage: catalog show <componentId>');
  process.exit(2);
}

Try / catch

try {
  main();
} catch (err) {
  if (err.message === 'Catalog show requires an install component ID') {
    console.error('Usage: catalog show <install-component-id>');
    process.exit(2);
  }
  throw err;
}

Prevention

When it happens

Trigger: `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.

Common situations: Users forgetting the ID argument; scripts building CLI args dynamically and dropping an unset variable; IDE run configurations with missing program arguments.

Understand the failure class

Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/df7ddf5e020ecacb. Report an issue: GitHub.

Appendix: source

Thrown at scripts/catalog.js:168

      return;
    }

    if (options.command === 'components') {
      const components = listInstallComponents({
        family: options.family,
        target: options.target,
      });
      if (options.json) {
        console.log(JSON.stringify({ components }, null, 2));
      } else {
        printComponents(components);
      }
      return;
    }

    if (options.command === 'show') {
      if (!options.componentId) {
        throw new Error('Catalog show requires an install component ID');
      }
      const component = getInstallComponent(options.componentId);
      if (options.json) {
        console.log(JSON.stringify(component, null, 2));
      } else {
        printComponent(component);
      }
      return;
    }

    throw new Error(`Unknown catalog command: ${options.command}`);
  } catch (error) {
    console.error(`Error: ${error.message}`);
    process.exit(1);
  }
}

main();

View on GitHub (pinned to 8321021c54)