pbakaus/impeccable · error

embed-prompt: no such path {}

Error message

embed-prompt: no such path {}

What it means

The `impeccable embed-prompt --scan` command validates every directory passed via --scan before walking it for raster images. If any target path does not exist on disk, the CLI prints this message and exits with code 1 instead of silently skipping it.

Source

Thrown at crates/context/src/embed_prompt.rs:206

    let abs = |p: &str| -> String { jsp::resolve(&cwd, &[p]) };
    let file = args.iter().find(|a| !a.starts_with("--")).cloned();
    let read_mode = args.iter().any(|a| a == "--read");
    let scan_mode = args.iter().any(|a| a == "--scan");
    let arg_of = |name: &str| -> Option<String> {
        let i = args.iter().position(|a| a == name)?;
        args.get(i + 1).cloned()
    };

    if scan_mode {
        let targets: Vec<&String> = args.iter().filter(|a| !a.starts_with("--")).collect();
        if targets.is_empty() {
            io.err("embed-prompt: --scan needs at least one directory\n");
            return 1;
        }
        let mut rasters: Vec<String> = Vec::new();
        for t in &targets {
            if !exists(&abs(t)) {
                io.err(&format!("embed-prompt: no such path {}\n", t));
                return 1;
            }
            // JS walks with the path as given (relative to cwd); output uses that spelling.
            let saved = std::env::current_dir().ok();
            let _ = std::env::set_current_dir(&cwd);
            let r = walk(t, true, &mut rasters);
            if let Some(s) = saved {
                let _ = std::env::set_current_dir(s);
            }
            if let Err(e) = r {
                io.err(&format!("Error: {}\n", e));
                return 1;
            }
        }
        let mut missing = 0;
        for r in &rasters {
            if prompt_of(&abs(r)).is_none() {
                io.out(&format!("MISSING: {}\n", r));

View on GitHub (pinned to 2bc2879276)

Solutions

  1. Check the path exists relative to your current working directory (ls the exact spelling you passed).
  2. Use absolute paths in scripts/CI to avoid cwd dependence.
  3. Fix typos or re-create the missing directory before re-running.

Example fix

// before
impeccable embed-prompt --scan ./dist/imgs
// after
ls ./dist/imgs || echo 'missing'; impeccable embed-prompt --scan "$PWD/dist/imgs"
Defensive patterns

Strategy: validation

Validate before calling

for p in "$@"; do [ -e "$p" ] || { echo "no such path: $p" >&2; exit 1; }; done

Type guard

const exists = (p) => { try { return fs.existsSync(p); } catch { return false; } };

Prevention

When it happens

Trigger: Running `impeccable embed-prompt --scan <dir>` (or positional targets) where one of the given paths was deleted, renamed, is on an unmounted volume, or is misspelled relative to the current working directory.

Common situations: Typoed directory names in scripts or CI, running from a different working directory than expected (relative paths resolve against cwd), or scanning a path removed between command composition and execution.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of pbakaus/impeccable@2bc2879276 (2026-09-08). Data as JSON: /api/errors/a836dd93159275f1. Report an issue: GitHub.