MongoDB "atlas: command not found" (Atlas CLI) in CI
The Atlas CLI (atlas) is a separate tool from mongosh and the driver, and it is not preinstalled on GitHub runners. Any atlas ... step fails until it is installed and authenticated with API keys.
What this error means
A step calling atlas clusters list or atlas accessLists create fails with "atlas: command not found" and exit code 127.
/home/runner/work/_temp/script.sh: line 1: atlas: command not found
Error: Process completed with exit code 127.Common causes
The Atlas CLI is not installed
Runners ship mongosh at most; the atlas binary must be installed explicitly before use.
Confusing atlas with mongosh
The Atlas CLI manages cloud resources (clusters, access lists, API keys) and is distinct from the mongosh data shell.
How to fix it
Install the Atlas CLI, then authenticate with API keys
- Install the Atlas CLI from the MongoDB apt repo or the release archive.
- Set
ATLAS_PUBLIC_KEYandATLAS_PRIVATE_KEY(and project id) as secrets. - Run atlas commands non-interactively.
curl -sL https://fastdl.mongodb.org/mongocli/mongodb-atlas-cli_1.30.0_linux_x86_64.tar.gz | tar xz
sudo mv atlascli_*/bin/atlas /usr/local/bin/atlas
export MONGODB_ATLAS_PUBLIC_API_KEY="$ATLAS_PUBLIC_KEY"
export MONGODB_ATLAS_PRIVATE_API_KEY="$ATLAS_PRIVATE_KEY"Verify the CLI is authenticated
Confirm the API keys work before running resource commands.
atlas projects listHow to prevent it
- Install the Atlas CLI as an explicit setup step.
- Provide API keys via environment variables from secrets.
- Keep the CLI version pinned for reproducibility.