{"record":{"id":"77a5a49b8fbf4662","repo":"tinyhumansai/openhuman","slug":"unknown-agent-subcommand-other-run-openhuman","errorCode":null,"errorMessage":"unknown agent subcommand '{other}'. Run `openhuman agent --help`.","messagePattern":"unknown agent subcommand '(.+?)'\\. Run `openhuman agent --help`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/agent_cli.rs","lineNumber":42,"sourceCode":"use std::path::PathBuf;\n\nuse crate::openhuman::agent::debug::{\n    dump_agent_prompt, dump_all_agent_prompts, write_prompt_dumps, DumpPromptOptions, DumpedPrompt,\n};\nuse crate::openhuman::agent::harness::definition::AgentDefinitionRegistry;\n\n/// Entry point for `openhuman agent <subcommand>`.\npub fn run_agent_command(args: &[String]) -> Result<()> {\n    if args.is_empty() || is_help(&args[0]) {\n        print_agent_help();\n        return Ok(());\n    }\n\n    match args[0].as_str() {\n        \"dump-prompt\" => run_dump_prompt(&args[1..]),\n        \"dump-all\" => run_dump_all(&args[1..]),\n        \"list\" => run_list(&args[1..]),\n        other => Err(anyhow!(\n            \"unknown agent subcommand '{other}'. Run `openhuman agent --help`.\"\n        )),\n    }\n}\n\n// ---------------------------------------------------------------------------\n// dump-all\n// ---------------------------------------------------------------------------\n\nstruct DumpAllFlags {\n    out: PathBuf,\n    workspace: Option<PathBuf>,\n    model: Option<String>,\n    verbose: bool,\n}\n\nfn parse_dump_all_flags(args: &[String]) -> Result<DumpAllFlags> {\n    let mut out: Option<PathBuf> = None;","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/agent_cli.rs#L24-L60","documentation":"Thrown by run_agent_command (src/core/agent_cli.rs) when the first token after `openhuman agent` matches none of the supported subcommands (dump-prompt, dump-all, list) and is not a help token. It is a pure argument-dispatch failure; the error text points at `openhuman agent --help`.","triggerScenarios":"Running e.g. `openhuman agent prompts`, `openhuman agent dump`, `openhuman agent ls`, or misspelling dump-prompt/dump-all/list. Also passing a global flag first (`openhuman agent --model x dump-prompt`) so the flag token is treated as the subcommand.","commonSituations":"Exploring the CLI from memory, tab-completion gaps, scripts referencing a subcommand renamed or added in a newer version, or copy-pasting docs for a different build.","solutions":["Run `openhuman agent --help` and use one of the listed subcommands: dump-prompt, dump-all, list.","Check spelling: `dump-all` and `dump-prompt` are hyphenated, not underscored.","Put global options before the subcommand only if the parent parser accepts them there; the agent dispatcher expects the subcommand first."],"exampleFix":"# before\nopenhuman agent dumpall\n\n# after\nopenhuman agent dump-all --out ./prompts","handlingStrategy":"validation","validationCode":"const AGENT_SUBCOMMANDS: &[&str] = &[\"dump-prompt\", \"dump-all\", \"list\"];\n\nif !AGENT_SUBCOMMANDS.contains(&args[0].as_str()) {\n    eprintln!(\"unknown agent subcommand; valid: {AGENT_SUBCOMMANDS:?}\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = run_agent_command(&args) {\n    if e.to_string().contains(\"unknown agent subcommand\") {\n        print_agent_help(); // recover by showing usage instead of a bare error\n    }\n}","preventionTips":["Run `openhuman agent --help` before scripting an unfamiliar subcommand.","In automation, pin to a known CLI version so subcommand sets do not drift.","Use exact hyphenated spellings (dump-all, dump-prompt)."],"tags":["rust","cli","argument-parsing","agent-cli"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}