{"record":{"id":"6faa6bc8653a13c1","repo":"tinyhumansai/openhuman","slug":"out-dir-is-required","errorCode":null,"errorMessage":"--out <dir> is required","messagePattern":"--out <dir> is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/agent_cli.rs","lineNumber":105,"sourceCode":"                i += 2;\n            }\n            \"-v\" | \"--verbose\" => {\n                verbose = true;\n                i += 1;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\"Usage: openhuman agent dump-all --out <dir> [--workspace <path>] [--model <name>] [-v]\");\n                println!();\n                println!(\"Render every registered agent's turn-1 system prompt into <dir>.\");\n                println!(\"`integrations_agent` is expanded into one file per currently-connected\");\n                println!(\"Composio toolkit; if no toolkit is connected, it is skipped.\");\n                std::process::exit(0);\n            }\n            other => return Err(anyhow!(\"unknown dump-all arg: {other}\")),\n        }\n    }\n    Ok(DumpAllFlags {\n        out: out.ok_or_else(|| anyhow!(\"--out <dir> is required\"))?,\n        workspace,\n        model,\n        verbose,\n    })\n}\n\nfn run_dump_all(args: &[String]) -> Result<()> {\n    let flags = parse_dump_all_flags(args)?;\n    init_quiet_logging(flags.verbose);\n\n    log::debug!(\n        \"[agent-cli] run_dump_all entry: out={} workspace={:?} model={:?}\",\n        flags.out.display(),\n        flags.workspace,\n        flags.model\n    );\n\n    let rt = tokio::runtime::Builder::new_multi_thread()","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/agent_cli.rs#L87-L123","documentation":"Thrown at the end of parse_dump_all_flags when the loop finished without ever setting --out. Unlike the optional workspace/model flags, the output directory is mandatory for `openhuman agent dump-all`, and the Option is unwrapped with this explicit error.","triggerScenarios":"Running `openhuman agent dump-all` with only optional flags (`-v`, `--model x`, `--workspace w`) or with no arguments at all.","commonSituations":"Assuming dump-all prints to stdout like dump-prompt can, or a script stripping the --out pair on a condition that never fired.","solutions":["Add `--out <dir>` (or `-o <dir>`) — the directory every registered agent's turn-1 system prompt is rendered into.","If you wanted stdout output for a single agent, use `openhuman agent dump-prompt --agent <id>` instead."],"exampleFix":"# before\nopenhuman agent dump-all -v\n\n# after\nopenhuman agent dump-all --out ./agent-prompts -v","handlingStrategy":"validation","validationCode":"# shell: fail early if OUT_DIR unset\n: \"${OUT_DIR:?OUT_DIR must be set (output directory for prompt dump)}\"\nopenhuman agent dump-all --out \"$OUT_DIR\"","typeGuard":null,"tryCatchPattern":"match run_agent_command(&args) {\n    Err(e) if e.to_string().contains(\"--out <dir> is required\") => {\n        eprintln!(\"dump-all renders files, so an output directory is mandatory\");\n    }\n    other => other?,\n}","preventionTips":["Memorize the dump-all vs dump-prompt split: dump-all writes files and needs --out; dump-prompt prints and needs --agent.","Set required variables with `: \"${VAR:?msg}\"` guards in scripts."],"tags":["rust","cli","argument-parsing","required-argument"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}