# get_latest_version

> **Function** in `deepagents_cli`

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

Fetch the latest deepagents-cli version from PyPI, with caching.

Results are cached to `CACHE_FILE` to avoid repeated network calls.
The cache stores both the latest stable and pre-release versions so a
single PyPI request serves both code paths.

## Signature

```python
get_latest_version(
    *,
    bypass_cache: bool = False,
    include_prereleases: bool = False,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `bypass_cache` | `bool` | No | Skip the cache and always hit PyPI. (default: `False`) |
| `include_prereleases` | `bool` | No | When `True`, consider pre-release versions (alpha, beta, rc). Stable users should leave this `False`. (default: `False`) |

## Returns

`str | None`

The latest version string, or `None` on any failure.

---

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