Skip to main content

discover_cursor_binary

Function discover_cursor_binary 

Source
pub fn discover_cursor_binary(configured: Option<&str>) -> Result<PathBuf>
Expand description

Locate a working cursor agent binary.

Order: KRANZ_CURSOR_BIN env var → configuredagent on PATH → well-known install locations, ending with the Cursor-specific ~/.local/bin/agent (per docs/scoping/cursor-cli-backend.md, this is where the real install lived on the probe host). Each candidate is validated by running it with --version; the first one that succeeds wins. Errors list every attempt so the user can see what was tried.

KRANZ_CURSOR_BIN, when set and non-empty, is an exclusive override: only that path is probed, and a failure is returned immediately rather than falling through to PATH or the well-known fallback locations. Naming the binary explicitly and having it not work is an error, not a reason to search elsewhere.