zed-industries/zed · error

output dir is required

Error message

output dir is required

What it means

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.

Solutions

  1. Pass an explicit output directory: `--output /path/to/dir`
  2. Or run the command from the Zed repository root so the default path exists
  3. Verify the cwd with `pwd` before invoking if relying on the default

Example fix

# before (run from ~)
synthesize --repos https://github.com/a/b  # panic: output dir is required

# after
synthesize --repos https://github.com/a/b --output ~/evals-generated
Defensive patterns

Strategy: validation

Validate before calling

// shell: verify default target exists before relying on it
crates/edit_prediction_cli/evals-generated 2>/dev/null || test -d crates/edit_prediction_cli \
  || { echo "run from repo root or pass --output"; exit 1; }

Prevention

When it happens

Trigger: Running the synthesize command from any directory other than the Zed repository root without passing `--output`.

Common situations: Building/running the edit_prediction_cli binary standalone or from a scripts directory and forgetting the output flag.

Understand the failure class

Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/edfe6e78fdad4c59. Report an issue: GitHub.

Appendix: source

Thrown at crates/edit_prediction_cli/src/main.rs:1151

            use strum::IntoEnumIterator as _;
            for format in ZetaFormat::iter() {
                println!("{}", format.to_string().to_lowercase());
            }
            return;
        }

        Command::Synthesize(synth_args) => {
            let output_dir = if let Some(output_dir) = args.output {
                output_dir
            } else {
                let default_output_dir = env::current_dir()
                    .unwrap()
                    .join("crates/edit_prediction_cli/evals-generated");
                if default_output_dir.parent().unwrap().exists() {
                    std::fs::create_dir(&default_output_dir).ok();
                    default_output_dir
                } else {
                    panic!("output dir is required");
                }
            };
            let config = SynthesizeConfig {
                repo_urls: synth_args.repos.clone(),
                count: synth_args.count,
                max_commits: synth_args.max_commits,
                output_dir,
                fresh: synth_args.fresh,
            };
            gpui::block_on(async {
                if let Err(e) = run_synthesize(config).await {
                    eprintln!("Error: {:?}", e);
                    std::process::exit(1);
                }
            });
            return;
        }
        Command::SplitCommit(split_commit_args) => {

View on GitHub (pinned to f4178619ac)