affaan-m/ECC · error · Error
Unknown command
Error message
Unknown command: ${resolution.command} What it means
main throws when resolving a per-command help request for a command name not present in the COMMANDS map — i.e. `ecc <unknown-cmd> --help` (or an unregistered name reached resolveCommand's help path). The faulting input is resolution.command.
Solutions
- Run `ecc --help` to list valid commands.
- Fix the command name typo in the invocation or npm script.
- Register the command in COMMANDS (and package.json bin/files) if it is meant to exist.
Example fix
// before $ ecc help instal Error: Unknown command: instal // after $ ecc help install
Defensive patterns
Strategy: validation
Validate before calling
if (process.argv[2] === 'help') {
const target = process.argv[3];
if (target && !COMMANDS[target]) {
console.error(`No such command: ${target}. See ecc --help.`);
process.exit(1);
}
} Type guard
const hasCommand = (name) => typeof name === 'string' && !!COMMANDS[name];
Try / catch
try {
main();
} catch (err) {
if (/^Unknown command:/.test(err.message)) {
showHelp(1);
} else {
throw err;
}
} Prevention
- List commands with bare `ecc --help` instead of guessing `ecc help <name>`.
- Keep completions/docs in sync with the installed ECC version.
- Verify command names in scripts before chaining them in CI.
When it happens
Trigger: Running `ecc help <name>` or `ecc <name> --help` where <name> resolves through the help-command resolution path but is not a key in COMMANDS.
Common situations: Asking for help on a mistyped or removed command, old documentation referencing renamed commands, or shell completion suggesting stale command names.
Related errors
- Unknown command
- Unknown command
- Unknown memory command
- Agents directory not found
- --all-harnesses and --harness are mutually exclusive.
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/d5126f91a5d3a413.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/ecc.js:329
return 1;
}
function main() {
try {
const resolution = resolveCommand(process.argv);
if (resolution.mode === 'help') {
showHelp(0);
}
if (resolution.mode === 'help-command') {
if (!resolution.command) {
showHelp(0);
}
if (!COMMANDS[resolution.command]) {
throw new Error(`Unknown command: ${resolution.command}`);
}
process.exitCode = runCommand(resolution.command, ['--help']);
return;
}
process.exitCode = runCommand(resolution.command, resolution.args);
} catch (error) {
console.error(`Error: ${error.message}`);
process.exit(1);
}
}
main();
View on GitHub (pinned to 8321021c54)