Profiles
Profiles allow you to define named sets of configuration overrides that can be activated at runtime. Use profiles to switch between development, CI/CD, and production settings without modifying your base configuration.
You will learn
- Define environment-specific configuration overrides
- Switch contexts with a single flag or environment variable
- Define profiles as directories containing configuration files
- Multiple profiles can be activated and merged together
Configuration
Configure the profiles system in your atmos.yaml:
profiles:
base_path: "custom/profiles" # Optional: custom directory for profiles
default: "dev" # Optional: profile loaded when no --profile/ATMOS_PROFILE is set
profiles.base_pathCustom directory for profile storage. If relative, resolved from the
atmos.yamldirectory. If absolute, used as-is.Default: Not set (uses standard profile locations)
profiles.defaultName of a profile loaded automatically when neither the
--profileflag nor theATMOS_PROFILEenvironment variable is set.The default is treated as implicit — an explicit
--profileorATMOS_PROFILEalways wins, and a default profile's ownprofiles.defaultis ignored (no recursion).Default: Not set
Precedence
Atmos resolves the active profile using this precedence (highest first):
--profileflagATMOS_PROFILEenvironment variableprofiles.defaultin the baseatmos.yaml- No profile
Profiles apply on top of whatever base configuration was selected — including a base loaded
via --config or --config-path — so
atmos --config ./main.yaml --profile ci ... merges the ci profile over main.yaml, the
same way it would over an auto-discovered atmos.yaml.
Pinning a Profile Per Project
You can pin a profile for a whole project by setting ATMOS_PROFILE in a committed dotenv file and including it in the base atmos.yaml env section:
Atmos promotes ATMOS_-prefixed variables from the env section into its own environment before it resolves the active profile, so every atmos command in the project uses the dev profile automatically. An exported ATMOS_PROFILE (or a --profile flag) still wins, so per-command overrides like ATMOS_PROFILE=ci atmos … continue to work. See Pinning Atmos Configuration Per Project for details.
Profile Discovery
Atmos discovers profiles from multiple locations in the following precedence order (highest to lowest):
| Priority | Location | Description |
|---|---|---|
| 1 | profiles.base_path | Custom path configured in atmos.yaml |
| 2 | .atmos/profiles/ | Project-local hidden profiles |
| 3 | ~/.config/atmos/profiles/ | XDG user profiles (or $XDG_CONFIG_HOME/atmos/profiles/) |
| 4 | profiles/ | Project-local profiles |
When the same profile name exists in multiple locations, the higher-priority location takes precedence.
Creating Profiles
Directory-Based Profiles
Create a directory for each profile containing configuration files:
profiles/
├── developer/
│ ├── atmos.yaml # Profile configuration overrides
│ └── auth.yaml # Additional configuration files
├── ci/
│ └── atmos.yaml
└── production/
├── atmos.yaml
└── auth.yaml
__SELECT__ is a reserved profile directory name — it's the sentinel bare --profile uses to
trigger interactive selection, so a profile with that name can never be
activated explicitly. Atmos excludes any __SELECT__ directory from discovery.
Each profile directory can contain:
atmos.yaml- Main configuration overrides- Additional YAML files that will be merged
Profile Configuration
A profile's atmos.yaml can override any Atmos configuration setting:
Profile Metadata
The optional metadata section provides information about the profile:
metadata:
name: "profile-name" # Human-readable name
description: "Description" # What this profile is for
version: "1.0.0" # Semantic version
tags: # Searchable tags
- development
- debug
deprecated: false # Mark profile as deprecated
Using Profiles
Command-Line Flag
Activate a profile using the --profile flag:
# Activate a single profile
atmos --profile developer terraform plan vpc -s prod
# Activate multiple profiles (applied left-to-right)
atmos --profile ci,security terraform plan vpc -s prod
Environment Variable
Set the ATMOS_PROFILE environment variable:
# Single profile
export ATMOS_PROFILE=developer
atmos terraform plan vpc -s prod
# Multiple profiles (comma-separated)
export ATMOS_PROFILE="ci,security"
atmos terraform apply --auto-approve
Interactive Selection
Use --profile without a value to open a multi-select picker listing every profile Atmos
discovers (see Profile Discovery). Nothing is pre-checked by default — toggle
the profiles you want with space, then confirm — they're activated left-to-right in the order
shown, same as if you'd typed them explicitly.
atmos auth login -i core-auto/terraform --profile
Any profile name already typed explicitly alongside the bare flag (e.g. --profile ci --profile)
starts pre-checked in the picker, since you asked for it — but the form is still yours to edit,
including unchecking it.
This requires an interactive terminal. In CI, scripts, or any non-interactive context, use
--profile=<name> or ATMOS_PROFILE explicitly instead — --profile used bare there returns an
error rather than hanging.