Skip to main content

atmos config set

Set a value in your atmos.yaml configuration using a dot-notation path. The edit preserves comments, anchors/aliases, Atmos YAML functions, and Go templates.

atmos config set --help
 

Usage

atmos config set <path> <value> [--type <type>]

By default (--type=auto) the value's type is inferred in order: first from the Atmos config schema when <path> matches a known field (mcp.enabled writes a boolean, settings.terminal.max_width writes an int, and so on); otherwise from the type of the value already at <path> (a true/false already there infers bool, a bare number infers int/float); otherwise from the new value's own shape (5 infers int, true infers bool, 3.14 infers float). Only when none of those have an answer — the value doesn't even look like a bool/int/float, e.g. a plain word for a brand-new vars path — does it fall back to writing a string, and Atmos prints a warning in that case since the fallback is easy to miss. Pass --type explicitly to skip inference entirely.

Examples

# Type inferred from the schema -- writes a boolean, not the string "true".
atmos config set mcp.enabled true
atmos config set components.terraform.apply_auto_approve true

# Type inferred from the existing value at the path (no schema entry needed).
atmos config set vars.replicas 5

# Type inferred from the new value's own shape -- vars.debug_enabled has no
# schema entry and no existing value, but "true" looks like a bool, so it's
# written as one, not the literal string "true".
atmos config set vars.debug_enabled true

# String value (the fallback when nothing above has an answer -- Atmos warns
# here since "nan" looks like it could be numeric but can't be written as a
# float safely, so it's stored as the literal string instead).
atmos config set vars.threshold nan

# Explicit --type overrides inference.
atmos config set --type=string logs.level Debug
atmos config set --type=int settings.terminal.max_width 120

# Raw YAML literal (lists, maps).
atmos config set --type=yaml 'logs.exclude' '["a", "b"]'

# Target a specific file.
atmos config set logs.level Trace --config ./atmos.yaml

Arguments

<path> (required)
Dot-notation path to the value (e.g. logs.level).
<value> (required)
The value to set. Interpreted according to --type.

Flags

--type (string, default: auto)
How to interpret <value>: auto (infer from the schema, then from the existing value at the path, then from the new value's own shape, falling back to string), string, int, bool, float, null, or yaml (a raw YAML/yq literal inserted verbatim).
--config (string slice, inherited)
Target a specific atmos.yaml file instead of the one discovered in the current directory or git root. Must name exactly one file: config set edits a single concrete file on disk, so passing more than one --config value is rejected as ambiguous.
note

Edits that would alter or expand a YAML anchor or alias (including changing a value shared by an anchor) are rejected to avoid silently mutating shared data, as are multi-document YAML files and files that define the same anchor name more than once. Comments, anchors, indentation width, and line endings (CRLF/LF) are preserved, but blank lines between entries are dropped and non-indented sequence styles are normalized when a file is edited.