# version_check

URL: /milo-cli/api/milo/version_check/
Section: milo
Description: Non-blocking version check with periodic caching.

---

> For a complete page index, fetch /milo-cli/llms.txt.

Open LLM text
(/milo-cli/api/milo/version_check/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fversion_check%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fversion_check%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fversion_check%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fversion_check%2Findex.txt)

Module

#
`version_check`

Non-blocking version check with periodic caching.

1Class4Functions

## Classes

`VersionInfo`

4

▼

Result of a version check.

Result of a version check.

#### Attributes

Name
Type
Description

`current`

`str`

—

`latest`

`str`

—

`update_available`

`bool`

—

`message`

`str`

—

## Functions

`check_version`

4

`VersionInfo | None`

▼

Check PyPI for a newer version. Returns None if check is skipped.

Caches the r…

`def check_version(package_name: str, current_version: str, *, cache_dir: Path | None = None, check_interval: int = _CHECK_INTERVAL) -> VersionInfo | None`

Check PyPI for a newer version. Returns None if check is skipped.

Caches the result to avoid hitting PyPI on every invocation.
Returns None if within the cache interval or on any error.

##### Parameters

Name
Type
Description

`package_name`
`str`

`current_version`
`str`

`cache_dir`
`Path | None`

Default:`None`

`check_interval`
`int`

Default:`_CHECK_INTERVAL`

##### Returns

`VersionInfo | None`

`format_version_notice`

2

`str`

▼

Format a user-friendly update notice for stderr.

`def format_version_notice(info: VersionInfo, *, prog: str = '') -> str`

##### Parameters

Name
Type
Description

`info`
`VersionInfo`

`prog`
`str`

Default:`''`

##### Returns

`str`

`_detect_installer`

0

`str`

▼

Detect the package installer (uv or pip).

`def _detect_installer() -> str`

##### Returns

`str`

`_fetch_latest_version`

1

`str`

▼

Fetch the latest version from PyPI JSON API.

`def _fetch_latest_version(package_name: str) -> str`

##### Parameters

Name
Type
Description

`package_name`
`str`

##### Returns

`str`
