Manage the CLI after installation ↗
Manage Cortex CLI with a package manager or download script. Use either method in CI/CD pipelines or local environments.
Package managers
macOS and Linux
-
Upgrade to the latest version
brew upgrade cortexcli
-
Pin the installed version
brew pin cortexcli
-
Uninstall the CLI
brew uninstall cortexcli
Windows
-
Upgrade to the latest version
scoop update cortexcli
-
Prevent upgrades
scoop hold cortexcli
-
Allow upgrades again
scoop unhold cortexcli
-
Uninstall the CLI
scoop uninstall cortexcli
Automate binary downloads
Use this script for a manual installation. It downloads the latest release for your operating system and architecture. Replace your existing binary with the downloaded file. On macOS and Linux, make it executable with chmod +x.
crtx_resp=$(curl --fail "<CORTEX_API_URL>/public_api/v1/unified-cli/releases/download-link?os=<OS>&architecture=<ARCH>" \ -H "x-xdr-auth-id: <AUTH_ID>" \ -H "Authorization: ${CORTEX_API_KEY}") \ && crtx_url=$(echo $crtx_resp | jq -r ".signed_url") \ && crtx_file=$(echo $crtx_resp | jq -r ".file_name") \ && curl -o $crtx_file $crtx_url
Replace the placeholders
CORTEX_API_KEY: Your API key<CORTEX_API_URL>: Your tenant API base URL<AUTH_ID>: Your API key ID value<OS>: Your operating system —linux,darwin, orwindows<ARCH>: Your system architecture — such asamd64orarm64
For credential configuration options, see Authenticate credentials.
How the script works
The script:
- Requests a signed download link from Cortex Cloud for the latest release matching your OS and architecture.
- Uses
jqto extract the signed URL and binary filename. - Downloads the binary from the signed URL.