astrid-runtime/astrid · error

Directory does not exist

Error message

Directory does not exist: {}

What it means

Early validation guard at the top of run_build: the user-supplied target directory (positional path argument) does not exist on disk, so building cannot proceed. Fires when the path argument is misspelled or points to a deleted directory; when no path is given the current directory is used and is assumed to exist. A generic input-validation bail, not a systemic failure.

Solutions

  1. Check the path for typos and rerun from the project directory
  2. Create/restore the missing directory
  3. Run `astrid build` with no path argument to use the current directory
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-build/src/build.rs:20 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/094fc0c969e0ad2a. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-build/src/build.rs:20

use anyhow::{Result, bail};
use std::path::Path;
use tracing::info;

/// Main entrypoint for the `astrid build` Universal Packager command.
pub(crate) fn run_build(
    path: Option<&str>,
    output: Option<&str>,
    project_type: Option<&str>,
    from_mcp_json: Option<&str>,
) -> Result<()> {
    let target_dir = match path {
        Some(p) => Path::new(p).to_path_buf(),
        None => std::env::current_dir()?,
    };

    if !target_dir.exists() {
        bail!("Directory does not exist: {}", target_dir.display());
    }

    // Early exit for legacy `mcp.json` or `gemini-extension.json` quick convert
    if let Some(json_path_str) = from_mcp_json {
        let json_path = Path::new(json_path_str);
        let dir = json_path.parent().unwrap_or(Path::new(""));
        let file_name = json_path.file_name().unwrap_or_default().to_string_lossy();
        return crate::mcp::convert(dir, &file_name, output);
    }

    // Detect the project type if not explicitly provided
    let detected_type = if let Some(explicit) = project_type {
        explicit.to_string()
    } else {
        detect_project_type(&target_dir)?
    };

    info!("Detected project type: {detected_type}");

View on GitHub (pinned to affd8760f4)