MCPcopy Index your code
hub / github.com/github/copilot-sdk / get_cached_cli_path

Function get_cached_cli_path

python/copilot/_cli_download.py:85–106  ·  view source on GitHub ↗

Return the path to the cached CLI binary if it exists. Args: version: CLI version. Defaults to the pinned CLI_VERSION. Returns: Path to the binary, or None if not cached.

(version: str | None = None)

Source from the content-addressed store, hash-verified

83
84
85def get_cached_cli_path(version: str | None = None) -> str | None:
86 """Return the path to the cached CLI binary if it exists.
87
88 Args:
89 version: CLI version. Defaults to the pinned CLI_VERSION.
90
91 Returns:
92 Path to the binary, or None if not cached.
93 """
94 ver = version or CLI_VERSION
95 if not ver:
96 return None
97
98 try:
99 _, binary_name = get_asset_info()
100 except RuntimeError:
101 return None
102 binary_path = get_cache_dir(ver) / binary_name
103
104 if binary_path.exists():
105 return str(binary_path)
106 return None
107
108
109def _should_skip_download() -> bool:

Callers 1

get_or_download_cliFunction · 0.85

Calls 3

get_asset_infoFunction · 0.85
get_cache_dirFunction · 0.85
existsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…