Skip to main content

project_root_of

Function project_root_of 

Source
pub fn project_root_of(path: &Path) -> Option<PathBuf>
Expand description

#1315: the project path belongs to, for the CLI and the MCP server alike — the nearest git root at or above it, else the outermost directory with a project marker (Cargo.toml, package.json, …; #1437: a monorepo sub-package is not its own project). A broad root (~ as a dotfiles repository, /, an agent directory) never counts, and the walk continues past it. The result is canonical, so every entry point keys the project-scoped stores (local tasks, agent registry) on the same directory. None when no directory above path is a project.