astrid-runtime/astrid · error
{name} not found. Ensure it is installed alongside the astri
Error message
{name} not found. Ensure it is installed alongside the astrid CLI or available in PATH. What it means
find_companion_binary locates a companion executable (e.g. the build companion or daemon binary) by checking the CLI's own install directory and then falling back to PATH lookup via which::which. If neither finds an executable, it bails with this message naming the missing binary. The astrid CLI is modular and relies on sibling binaries shipped in the same install set.
Source
Thrown at crates/astrid-cli/src/bootstrap.rs:100
/// Locate a companion binary (e.g. `astrid-daemon`, `astrid-build`).
///
/// Search order:
/// 1. Same directory as the current executable (co-installed)
/// 2. `PATH` lookup
pub(crate) fn find_companion_binary(name: &str) -> Result<std::path::PathBuf> {
if let Ok(exe) = std::env::current_exe()
&& let Some(dir) = exe.parent()
{
let candidate = dir.join(name);
if candidate.is_file() {
return Ok(candidate);
}
}
if let Ok(path) = which::which(name) {
return Ok(path);
}
anyhow::bail!(
"{name} not found. Ensure it is installed alongside the astrid CLI \
or available in PATH."
)
}
/// Locate a security-sensitive companion only in the authenticated install set.
///
/// Unlike developer-oriented companion discovery, this deliberately refuses a
/// `PATH` fallback. A storage provider controls what filesystem the operator
/// sees, so the executable must be co-installed beside this CLI.
pub(crate) fn find_coinstalled_companion_binary(name: &str) -> Result<std::path::PathBuf> {
let executable = std::env::current_exe().context("resolve the Astrid CLI executable")?;
let directory = executable
.parent()
.context("the Astrid CLI executable has no installation directory")?;
let candidate = directory.join(format!("{name}{}", std::env::consts::EXE_SUFFIX));
if candidate.is_file() {
return Ok(candidate);View on GitHub (pinned to affd8760f4)
Solutions
- Install the full astrid CLI distribution so companion binaries sit beside the astrid executable.
- Add the install directory to PATH (or fix PATH in the current shell/container).
- Verify the expected binary name plus platform EXE_SUFFIX exists next to the astrid executable.
- If running from a source checkout, build the companion binaries (cargo build) so target/ contains them, and run via the workspace so siblings resolve.
Example fix
// before: PATH missing install prefix, companions absent $ astrid daemon start Error: astrid-daemon not found. Ensure it is installed alongside... // after $ export PATH="$HOME/.astrid/bin:$PATH" $ ls ~/.astrid/bin/astrid-daemon # present after full install $ astrid daemon start
Defensive patterns
Strategy: fallback
Validate before calling
let cli_dir = std::env::current_exe()?.parent().unwrap().to_path_buf();
let name = "astrid-daemon";
let sibling = cli_dir.join(format!("{name}{}", std::env::consts::EXE_SUFFIX));
if !sibling.is_file() && which::which(name).is_err() {
eprintln!("{name} missing; install the full astrid distribution");
} Type guard
fn companion_available(name: &str) -> bool {
std::env::current_exe().ok()
.and_then(|p| p.parent().map(|d| d.join(format!("{name}{}", std::env::consts::EXE_SUFFIX)).is_file()))
.unwrap_or(false)
|| which::which(name).is_ok()
} Try / catch
match spawn_daemon_inner(&config).await {
Ok(h) => { /* ... */ }
Err(e) if e.to_string().contains("not found. Ensure it is installed") => {
eprintln!("companion binary missing; reinstall the full astrid distribution");
}
Err(e) => return Err(e),
} Prevention
- Install the complete astrid distribution, not a single binary.
- Keep the install prefix on PATH.
- In containers, copy all astrid-* binaries into the same directory.
- Smoke-test companion lookup after install/upgrade.
When it happens
Trigger: Calling run_build_companion, spawn_daemon_inner, or spawn_persistent_daemon when the companion binary is neither next to the astrid CLI executable nor discoverable via PATH.
Common situations: Installing only the astrid CLI crate/binary without its companions (partial install, cargo install of a single bin); running astrid from a build directory where companions were not copied; a stripped container image that dropped the companion binaries; PATH not containing the install prefix.
Related errors
- {name} is not installed beside the Astrid CLI; refusing a PA
- Source path does not exist: {source}
- source path does not exist: {source}
- seal requires a local Distro.toml path or its directory; {di
- empty archive path
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/d5523962aafca8f2.
Report an issue: GitHub.