nikivdev/code · error

No flow.toml found. Use --url to specify a URL to check.

Error message

No flow.toml found. Use --url to specify a URL to check.

What it means

The health-check command requires a flow.toml config in the current project to resolve the target URL. When no flow.toml is found at all, the config load returns None and the CLI bails, suggesting --url as an override.

Source

Thrown at src/deploy.rs:3152

                let scheme = if host.ssl { "https" } else { "http" };
                format!("{}://{}", scheme, domain)
            } else {
                bail!("No domain configured. Use --url to specify a URL to check.");
            }
        } else if let Some(cf) = &config.cloudflare {
            // Use configured URL if present
            if let Some(cf_url) = &cf.url {
                cf_url.clone()
            } else {
                bail!(
                    "No URL configured in [cloudflare]. Add 'url = \"https://...\"' or use --url."
                );
            }
        } else {
            bail!("No deployment config found. Use --url to specify a URL to check.");
        }
    } else {
        bail!("No flow.toml found. Use --url to specify a URL to check.");
    };

    println!("Checking health: {}", url);
    let start = Instant::now();

    // Use curl for simplicity (available everywhere)
    let output = Command::new("curl")
        .args([
            "-sS",
            "-o",
            "/dev/null",
            "-w",
            "%{http_code}",
            "--max-time",
            "10",
            &url,
        ])
        .output()

View on GitHub (pinned to a747e741ae)

Solutions

  1. cd into the directory containing flow.toml and rerun
  2. Pass --url https://... to skip config resolution entirely
  3. Create flow.toml via the CLI init command

Example fix

// before
$ flow check   # run in ~/

// after
$ cd ~/projects/my-app
$ flow check
Defensive patterns

Strategy: validation

Validate before calling

// shell check before invoking
[ -f flow.toml ] || { echo "run from the directory containing flow.toml"; exit 1; }

Try / catch

// treat as user error, print hint
match result {
    Err(e) if e.to_string().contains("No flow.toml found") => {
        eprintln!("cd to your project root or pass --url");
    }
    Err(e) => return Err(e),
    Ok(v) => Ok(v),
}

Prevention

When it happens

Trigger: Running the check command from a directory (or above/below it) that contains no flow.toml, without passing --url.

Common situations: Running from the wrong working directory (e.g., repo root instead of app subdir); file named flow.toml.tpl or in a parent repo; brand-new project before `init`.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/1ed6fc15a34c9034. Report an issue: GitHub.