{"record":{"id":"edfe6e78fdad4c59","repo":"zed-industries/zed","slug":"output-dir-is-required","errorCode":null,"errorMessage":"output dir is required","messagePattern":"output dir is required","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":1151,"sourceCode":"            use strum::IntoEnumIterator as _;\n            for format in ZetaFormat::iter() {\n                println!(\"{}\", format.to_string().to_lowercase());\n            }\n            return;\n        }\n\n        Command::Synthesize(synth_args) => {\n            let output_dir = if let Some(output_dir) = args.output {\n                output_dir\n            } else {\n                let default_output_dir = env::current_dir()\n                    .unwrap()\n                    .join(\"crates/edit_prediction_cli/evals-generated\");\n                if default_output_dir.parent().unwrap().exists() {\n                    std::fs::create_dir(&default_output_dir).ok();\n                    default_output_dir\n                } else {\n                    panic!(\"output dir is required\");\n                }\n            };\n            let config = SynthesizeConfig {\n                repo_urls: synth_args.repos.clone(),\n                count: synth_args.count,\n                max_commits: synth_args.max_commits,\n                output_dir,\n                fresh: synth_args.fresh,\n            };\n            gpui::block_on(async {\n                if let Err(e) = run_synthesize(config).await {\n                    eprintln!(\"Error: {:?}\", e);\n                    std::process::exit(1);\n                }\n            });\n            return;\n        }\n        Command::SplitCommit(split_commit_args) => {","sourceCodeStart":1133,"sourceCodeEnd":1169,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L1133-L1169","documentation":"For the `synthesize` subcommand, when no `--output` is given the CLI defaults to `<cwd>/crates/edit_prediction_cli/evals-generated`. It checks that the parent of that default (`<cwd>/crates/edit_prediction_cli`) exists — true only when running from the Zed repo root. Otherwise it panics with 'output dir is required' rather than writing to an arbitrary location.","triggerScenarios":"Running the synthesize command from any directory other than the Zed repository root without passing `--output`.","commonSituations":"Building/running the edit_prediction_cli binary standalone or from a scripts directory and forgetting the output flag.","solutions":["Pass an explicit output directory: `--output /path/to/dir`","Or run the command from the Zed repository root so the default path exists","Verify the cwd with `pwd` before invoking if relying on the default"],"exampleFix":"# before (run from ~)\nsynthesize --repos https://github.com/a/b  # panic: output dir is required\n\n# after\nsynthesize --repos https://github.com/a/b --output ~/evals-generated","handlingStrategy":"validation","validationCode":"// shell: verify default target exists before relying on it\ncrates/edit_prediction_cli/evals-generated 2>/dev/null || test -d crates/edit_prediction_cli \\\n  || { echo \"run from repo root or pass --output\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --output when invoking synthesize outside the Zed repo root","Pin the working directory (cd to repo root) in scripts that rely on the default output path"],"tags":["edit-prediction-cli","cli-arguments","output-path","panic"],"backgroundTag":"missing-required-option","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}