Atlas CLI Environment Variables
On this page
For easier scripting, you can specify configuration settings by using environment variables.
Precedence
When you run any command, each setting that you specify with an environment variable takes precedence over the profile stored in the configuration file.
When you run a command using the
--projectId
option, the command line option takes precedence over both the environment variable and the profile stored in the configuration file.
Supported Environment Variables
Important
Atlas CLI supports both MongoDB CLI environment variables and Atlas CLI environment variables. You can use either MongoDB CLI environment variables or Atlas CLI environment variables, but not both together.
The Atlas CLI supports the following environment variables:
Variable | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| Flag that indicates whether telemetry is disabled for the
Atlas CLI. Set to You can also enable or disable telemetry with
| ||||||||||
| Sets the public API key for commands that interact with Atlas. | ||||||||||
| Sets the private API key for commands that interact with Atlas. | ||||||||||
| Sets the organization ID for commands that require the
| ||||||||||
| Sets the project ID for commands that require the | ||||||||||
| Sets the output fields and format. Valid values are:
| ||||||||||
| The full path on your local system to the MongoDB Shell,
| ||||||||||
| When set to | ||||||||||
| String that grants access to your Atlas account. The access token is valid for 12 hours. | ||||||||||
| String that allows Atlas to automatically request a new access token when the current access token expires. | ||||||||||
| Flag that indicates whether telemetry is enabled for the
Atlas CLI. Set to You can also enable or disable telemetry with | ||||||||||
| The absolute URL or the hostname and port in the
The following examples show how to set up the environment variable in different situations:
| ||||||||||
| The absolute URL. If The following example shows how to set up the environment variable:
| ||||||||||
| Indicates no proxy for the URL because proxy isn't configured for the URL. |