Docs Home → Atlas Command Line Interface
Save Connection Settings![](/docs/atlas/cli/v1.0/assets/link.svg)
On this page
You can save your frequently-used connection settings as profiles.
Profiles store the project IDs, organization
IDs, and, optionally, API keys to use in future Atlas CLI
sessions. To save time, you can specify a profile instead of using the
--projectId
and --orgId
flags with each command. The Atlas CLI
stores your profiles in a configuration file
called config.toml
.
Note
Any settings stored in environment variables
take precedence over settings stored in profiles. Any project or organization
specified with the --projectId
and --orgId
flags take precedence over
both the profile and the environment variables.
Locate the Configuration File![](/docs/atlas/cli/v1.0/assets/link.svg)
The Atlas CLI saves the configuration file to the following location depending on your operating system:
The Atlas CLI grants the user who ran the command read and write access to the file.
Create a Profile![](/docs/atlas/cli/v1.0/assets/link.svg)
The first time you run the
atlas auth login
or atlas config init
command, the
Atlas CLI automatically creates the config.toml
file and a default
profile. If you run a command without specifying a profile, environment
variables, or --projectId
and --orgId
flags, the Atlas CLI uses the
default profile for the command.
Select Your Use Case![](/docs/atlas/cli/v1.0/assets/link.svg)
Select a connection method based on your use case:
Command | Authentication Method | Use Case |
---|---|---|
atlas auth login | Atlas login credentials and an authentication token | Best for non-programmatic use |
atlas config init | API keys | Best for programmatic use |
To learn more, see Select a Connection Method.
Complete the Prerequisites![](/docs/atlas/cli/v1.0/assets/link.svg)
Add your host's IP address to the IP access list.
If you select
atlas config init
as your connection method, you must Configure API keys.
Follow These Steps![](/docs/atlas/cli/v1.0/assets/link.svg)
Select a use case and follow the procedure to create a profile.
Update a Profile![](/docs/atlas/cli/v1.0/assets/link.svg)
You can update the settings stored in your configuration file in the following ways:
Edit the
config.toml
file with a text editor.Run the
atlas config set
command for a setting. This edits an individual value in theconfig.toml
file.
Run a Command with a Profile![](/docs/atlas/cli/v1.0/assets/link.svg)
To run an Atlas CLI command using a profile:
Append the
--profile <profileName>
flag to a command or omit the--profile <profileName>
flag to use the default profile.
Example
This command uses a profile named myProfile
:
atlas <command> --profile myProfile
This command uses the default profile:
atlas <command>