affaan-m/ECC · error · Error
Unknown command: ${firstArg}
Error message
Unknown command: ${firstArg} What it means
Thrown by the ECC CLI entrypoint (scripts/ecc.js) when the first positional argument is not a known subcommand, not a recognized legacy language, and does not start with a dash (flag). The CLI tries to resolve the first argument as a command name, then falls back to treating it as an implicit 'install' if it looks like a flag or a known language; anything else is rejected as unknown.
Source
Thrown at scripts/ecc.js:246
};
}
if (COMMANDS[firstArg]) {
return {
mode: 'command',
command: firstArg,
args: restArgs,
};
}
const knownLegacyLanguages = listAvailableLanguages();
const shouldTreatAsImplicitInstall = (
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],View on GitHub (pinned to 01e15490f0)
Solutions
- Run `node scripts/ecc.js --help` to see the list of valid commands.
- Check for typos in the command name you passed as the first argument.
- If you expect it to be treated as an install target, verify it appears in listAvailableLanguages() or prefix it with a dash flag.
- Update ECC to the latest version in case the command was renamed or added.
Example fix
// before node scripts/ecc.js instal typescript // after node scripts/ecc.js install typescript
Defensive patterns
Strategy: validation
Validate before calling
const knownCommands = Object.keys(COMMANDS);
const knownLangs = listAvailableLanguages();
if (!knownCommands.includes(firstArg) && !firstArg.startsWith('-') && !knownLangs.includes(firstArg)) {
console.error(`Invalid command: ${firstArg}. Available: ${knownCommands.join(', ')}`);
process.exit(1);
} Type guard
function isKnownCommand(arg, COMMANDS, languages) {
return Object.prototype.hasOwnProperty.call(COMMANDS, arg)
|| arg.startsWith('-')
|| languages.includes(arg);
} Prevention
- Always run with --help first when unsure of available commands.
- Wrap the CLI in a shell function that validates the first arg against --help output.
- Pin ECC to a known version so the command set does not change unexpectedly.
When it happens
Trigger: Running `node scripts/ecc.js <something>` where `<something>` is neither a registered command in COMMANDS, nor a flag (does not start with '-'), nor a value returned by listAvailableLanguages(). For example `npx ecc foo` or a typo like `npx ecc instal` (missing 'l').
Common situations: Typos in subcommand names (e.g. 'instal' instead of 'install'), using a command that was removed or renamed in a newer ECC version, or passing a positional that the user thinks is valid but is not in the legacy languages list.
Related errors
- Unknown command: ${resolution.command}
- Unknown argument: ${arg}
- Expected at most one agents directory argument
- ${flagName} requires a value
- Unknown argument: ${arg}
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/724da75f0d13d262.
Report an issue: GitHub.