JuliusBrussee/caveman · error
unknown command ; run caveman-agent --help
Error message
unknown command ${JSON.stringify(command)}; run caveman-agent --help What it means
The caveman-agent CLI main() dispatches known commands (including dev, build, check, doctor, register). If the first positional argument does not match any known command, it throws this error listing the attempted command and pointing at --help.
Solutions
- Run `caveman-agent --help` to list valid commands.
- Correct the typo in the command name (e.g. doctor, not docter).
- Check the installed package version; if a documented command is missing, upgrade the package.
Example fix
// before npx caveman-agent docter // after npx caveman-agent doctor
Defensive patterns
Strategy: validation
Validate before calling
const COMMANDS = ["dev", "build", "check", "doctor", "register"];
if (!COMMANDS.includes(process.argv[2] ?? "")) {
console.error(`unknown command; run caveman-agent --help`);
process.exit(1);
} Try / catch
main(process.argv.slice(2)).catch((e) => {
if (String(e.message).startsWith("unknown command")) {
console.error(e.message);
process.exit(2);
}
throw e;
}); Prevention
- Run `caveman-agent --help` when unsure of a command name
- Shell-complete command names instead of typing from memory
- Pin and consult docs matching your installed package version
When it happens
Trigger: Running `caveman-agent <typo>` (e.g. "caveman-agent docter", "caveman-agent verion") or invoking a subcommand that does not exist in this CLI version.
Common situations: Typo in the command name; reading outdated docs for a command that was renamed or removed; shell alias resolving to an unexpected first argument.
Related errors
- caveman-cloud MCP changed after setup; refusing destructive…
- caveman-cloud MCP changed during interrupted setup…
- caveman-cloud MCP changed during interrupted removal…
- caveman-cloud MCP postflight mismatch
- caveman-cloud MCP registration failed exact postflight
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/4050e1db4ac658ce.
Report an issue: GitHub.
Appendix: source
Thrown at packages/agent/src/cli.ts:92
return;
}
if (command === "build") {
await build(args);
return;
}
if (command === "check") {
await check(args);
return;
}
if (command === "doctor") {
await doctor(args);
return;
}
if (command === "register") {
await register(args);
return;
}
throw new Error(`unknown command ${JSON.stringify(command)}; run caveman-agent --help`);
}
function printHelp(): void {
process.stdout.write([
"Caveman Agent — efficiency-native TypeScript agent framework",
"",
"Usage:",
"caveman-agent dev [entry] [prompt]",
"caveman-agent build [config]",
"caveman-agent check [config]",
"caveman-agent doctor [--json]",
"caveman-agent register",
"caveman-agent --version",
"",
].join("\n"));
}
type DoctorStatus = "pass" | "warn" | "fail";View on GitHub (pinned to 3ee70a1026)