Skip to main content

atmos.list

The atmos.list function runs atmos list through the current Atmos executable. Use it to discover stacks, components, instances, workflows, and other project objects, and to feed the results into the rest of a script.

Usage​

atmos.list(
*positionals,
flags = {},
args = [],
working_directory = ...,
env = ...,
output = "capture",
check = True,
)

Calls default to JSON and captured output. Read result.data directly; result.stdout retains the raw JSON. Explicit formats and output = "stream" override these defaults. Subcommands without a --format flag retain their native format. See query defaults.

Subcommands​

Pass the subcommand as a string before the keyword arguments. The call atmos.list("stacks") runs atmos list stacks.

SubcommandPurpose
stacksList all Atmos stacks.
componentsList all Atmos components.
instancesList all Atmos instances.
affectedList affected components and stacks.
dependenciesList Atmos component dependencies.
metadataList metadata across stacks.
settingsList settings across stacks or for a specific component.
valuesList component values across stacks.
varsList component vars across stacks.
sourcesList components with source configuration.
vendorList all vendor configurations.
workflowsList all Atmos workflows.
editionsList the journal of default changes between Atmos editions.
themesList available terminal themes.
profilesList available configuration profiles.
aliasesList all command aliases, built-in and configured.
git-repositoriesList configured Git repositories.

See the atmos list command reference for the complete list of subcommands and flags.

Arguments​

*positionals

(Optional) Strings placed on the command line right after list, in order: the subcommand and its positional arguments. Every value must be a string.

flags

(Optional) A dictionary of command-line options; see flag translation. A bare key such as "format" becomes --format, and registered shorthands resolve to their long form, so "s" becomes --stack for subcommands that have it. Common flags include "format", "columns", "sort", "stack", and "component".

args
(Optional) A list or tuple of strings appended after the flags.
working_directory, env, output, check

(Optional) See atmos.run for process options and defaults.

Options other than the positionals are keyword-only.

Returns​

A result with decoded JSON in data, raw text in stdout and stderr, and exit_code. See atmos.run for output and error behavior.

The data attribute decodes the captured JSON on first access. Use stdout for the original text.

Examples​

Loop over every stack​

stacks = atmos.list("stacks").data
for entry in stacks:
ui.info("Found stack " + entry["Stack"])

The JSON output is a list of objects whose keys match the table column headings, such as Stack.

List the components in one stack​

components = atmos.list("components", flags = {"stack": "dev"}).data
for entry in components:
print(entry["Component"], entry["Type"])

This runs atmos list components --stack=dev --format=json.

Count instances​

instances = atmos.list("instances").data
print("Instances:", len(instances))

Read the table as text​

atmos.list("workflows", flags = {"format": "csv"})