Skip to main content

install_bundled_cli

Function install_bundled_cli 

Source
pub fn install_bundled_cli() -> Option<PathBuf>
Expand description

Returns the path to the bundled Copilot CLI, extracting it from the embedded archive on first call.

This exposes the full CLI artifact directly for callers such as health checks, diagnostics, and version probes. Managed child-process and in-process transports resolve the bundled runtime artifacts instead.

Subsequent calls return the cached result. Extraction is skipped when an already-published binary passes a cheap integrity re-check; a truncated, empty, or antivirus-quarantined binary is re-extracted and re-verified rather than returned.

Returns None when the bundled-cli feature is off, the target platform isn’t supported by build.rs, or extraction failed (the failure is logged via tracing::warn!). When None is returned for the “feature off” reason, HAS_BUNDLED_CLI is also false.

This deliberately does not fall back to the build-time-extracted dev-cache path used when bundled-cli is off — callers that want that resolution should continue to use CliProgram::Resolve.