affaan-m/ECC · error · Error
Unknown command: ${commandName}
Error message
Unknown command: ${commandName} What it means
Thrown by runCommand() in scripts/ecc.js when the resolved command name does not exist in the COMMANDS registry. Unlike error 60 (which fires during argument resolution), this fires at execution time, meaning the command name passed validation but was not found in the internal command map. In practice this is a secondary guard after resolveCommand.
Source
Thrown at scripts/ecc.js:259
firstArg.startsWith('-')
|| knownLegacyLanguages.includes(firstArg)
);
if (!shouldTreatAsImplicitInstall) {
throw new Error(`Unknown command: ${firstArg}`);
}
return {
mode: 'command',
command: 'install',
args,
};
}
function runCommand(commandName, args) {
const command = COMMANDS[commandName];
if (!command) {
throw new Error(`Unknown command: ${commandName}`);
}
const isItoLogin = commandName === 'ito' && getInvocationCommand(args) === 'login';
const result = spawnSync(
process.execPath,
[path.join(__dirname, command.script), ...args],
{
cwd: process.cwd(),
env: commandName === 'ito'
? {
...createSafeItoInvocationEnvironment(process.env, args, {
includeControls: true,
}),
}
: process.env,
stdio: isItoLogin || commandName === 'setup' || commandName === 'install'
? 'inherit'
: commandName === 'memory'
? ['inherit', 'pipe', 'pipe']View on GitHub (pinned to 01e15490f0)
Solutions
- Inspect the COMMANDS object in scripts/ecc.js to confirm the command is registered.
- Check that the command name is spelled correctly and matches a key in COMMANDS exactly.
- If this is a custom/extended command, ensure it was properly added to the COMMANDS map.
- Run with --help to see which commands are actually available in your version.
Defensive patterns
Strategy: validation
Validate before calling
if (!Object.prototype.hasOwnProperty.call(COMMANDS, commandName)) {
throw new Error(`Command '${commandName}' is not registered. Available: ${Object.keys(COMMANDS).join(', ')}`);
} Type guard
function isRegisteredCommand(name, registry) {
return typeof name === 'string' && Object.prototype.hasOwnProperty.call(registry, name);
} Prevention
- When extending ECC with custom commands, always register them in the COMMANDS map.
- Add a unit test that verifies every resolvable command name exists in COMMANDS.
- Log the available commands in the error message for faster debugging.
When it happens
Trigger: Internally calling runCommand(commandName, args) with a commandName that is not a key in the COMMANDS object. This can happen if resolveCommand has a logic gap, or if the command registry was modified or a command was removed between resolution and execution.
Common situations: A plugin or extension registered a command name in resolution logic but not in the COMMANDS map, or a command was deprecated and removed from COMMANDS but references remain. Also reachable via help-command mode if the command name is passed programmatically.
Related errors
- Unknown argument: ${arg}
- Failed to read ${normalizePath(path.relative(ROOT, outputPat
- ${normalizePath(path.relative(ROOT, outputPath))} is out of
- Unknown argument: ${arg}
- --timeout-ms must be a positive number
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/1cc6bc03f53465de.
Report an issue: GitHub.