# find_project_root

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/project_utils/find_project_root)

Find the project root by looking for .git directory.

Walks up the directory tree from start_path (or cwd) looking for a .git
directory, which indicates the project root.

## Signature

```python
find_project_root(
    start_path: str | Path | None = None,
) -> Path | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `start_path` | `str \| Path \| None` | No | Directory to start searching from. Defaults to current working directory. (default: `None`) |

## Returns

`Path | None`

Path to the project root if found, None otherwise.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a9e6e4f7ad7fe161dd9affc3d74bb19784aca70b/libs/cli/deepagents_cli/project_utils.py#L135)