atmos list affected
Use this command to list affected Atmos components and stacks between Git commits. View results in multiple formats including tables, JSON, YAML, CSV, or hierarchical trees with custom column selection, filtering, and sorting.
Usageβ
Execute the list affected command like this:
atmos list affected
To compare against a specific Git reference:
atmos list affected --ref refs/heads/main
Run atmos list affected --help to see all the available options
Examplesβ
List all affected components:
atmos list affected
Compare against specific branch or commit:
# Compare against main branch
atmos list affected --ref refs/heads/main
# Compare against specific commit
atmos list affected --sha abc123def456
Output in different formats:
# JSON format
atmos list affected --format json
# YAML format
atmos list affected --format yaml
# CSV format for scripting
atmos list affected --format csv
Filter and sort results:
# Filter by specific stack
atmos list affected --stack prod-us-east-1
# Sort by component name
atmos list affected --sort component:asc
# Sort by multiple columns
atmos list affected --sort "stack:asc,component:desc"
Include dependent components:
# Show components that depend on affected components
atmos list affected --include-dependents
Custom columns:
# Simple field names
atmos list affected --columns component,stack,affected
# Named columns with templates
atmos list affected --columns "Component={{ .component }},Stack={{ .stack }}"
Working with private repositories:
# Use SSH key for cloning
atmos list affected --ssh-key ~/.ssh/id_rsa --clone-target-ref
# Use pre-cloned repository (for CI/CD)
atmos list affected --repo-path /tmp/target-repo
Flagsβ
--ref- Git reference to compare against (e.g.,
refs/heads/main). Defaults torefs/remotes/origin/HEAD.
Environment variable:ATMOS_AFFECTED_REF --sha- Git commit SHA to compare against. Takes precedence over
--ref.
Environment variable:ATMOS_AFFECTED_SHA --format/-f- Output format:
table,json,yaml,csv,tsv(default:table).
Environment variable:ATMOS_LIST_FORMAT --columns- Columns to display. Supports simple field names (e.g.,
component,stack), named columns with templates (e.g.,"Name={{ .component }}"), or field references (e.g.,"MyStack=stack").
Environment variable:ATMOS_LIST_COLUMNS --sort- Sort by column:order (e.g.,
stack:asc,component:desc). Multiple sort columns separated by comma.
Environment variable:ATMOS_LIST_SORT --delimiter- Delimiter for CSV/TSV output (default:
,for CSV,\tfor TSV).
Environment variable:ATMOS_LIST_DELIMITER --stack- Filter results to a specific stack.
Environment variable:ATMOS_STACK --include-dependents- Include dependent components as separate rows with depth indicators.
Environment variable:ATMOS_AFFECTED_INCLUDE_DEPENDENTS --exclude-locked- Exclude components with
metadata.locked: truefrom results.
Environment variable:ATMOS_AFFECTED_EXCLUDE_LOCKED --repo-path- Path to already-cloned target repository. Conflicts with
--ref,--sha,--ssh-key, and--ssh-key-password.
Environment variable:ATMOS_AFFECTED_REPO_PATH --ssh-key- Path to PEM-encoded private key for SSH cloning.
Environment variable:ATMOS_AFFECTED_SSH_KEY --ssh-key-password- Password for encrypted PEM key.
Environment variable:ATMOS_AFFECTED_SSH_KEY_PASSWORD --clone-target-ref- Clone target reference instead of checking it out locally (default:
false). Required for private repositories when SSH credentials are provided.
Environment variable:ATMOS_AFFECTED_CLONE_TARGET_REF --process-templates- Enable/disable Go template processing (default:
true).
Environment variable:ATMOS_AFFECTED_PROCESS_TEMPLATES --process-functions- Enable/disable YAML function processing (default:
true).
Environment variable:ATMOS_AFFECTED_PROCESS_FUNCTIONS --skip- Skip specific YAML functions. Use multiple
--skipflags or comma-separated values.
Environment variable:ATMOS_AFFECTED_SKIP --identity/-i(optional)- Authenticate with a specific identity before listing affected components. Required when YAML functions need credentials.
Environment variable:ATMOS_IDENTITY
Default Columnsβ
The default table output shows:
| Column | Description |
|---|---|
| Status | Visual indicator: β (enabled), β (locked), β (disabled) |
| Component | Affected component name |
| Stack | Affected stack name |
| Type | Component type (terraform, helmfile, etc.) |
| Affected | Reason for being affected (component, file, folder, stack.vars, etc.) |
| File | External file that changed (if applicable) |
Available Fieldsβ
All fields from atmos describe affected are available for custom columns:
component- Component namecomponent_type- Component type (terraform/helmfile/packer)component_path- Filesystem path to componentstack- Stack namestack_slug- Stack-component concatenationnamespace,tenant,environment,stage- Stack naming partsaffected- Primary reason for being affectedaffected_all- All reasons (comma-separated)file- External file that changedfolder- External folder that changedspacelift_stack- Spacelift stack nameatlantis_project- Atlantis project nameenabled- Component enabled statuslocked- Component locked statusstatus- Visual status indicatoris_dependent- Whether component is a dependentdepth- Dependency nesting depthdependents_count- Number of dependent components
Comparison with atmos describe affectedβ
| Feature | list affected | describe affected |
|---|---|---|
| Default format | Table | JSON |
| Formats supported | table, json, yaml, csv, tsv | json, yaml |
| Custom columns | Yes | No |
| Sorting | Yes (multi-column) | No |
| Status indicator | Yes (β/β/β) | No |
| Dependencies | Flattened rows | Nested structure |
| Use case | Quick overview, human-readable | Full details, machine processing |
Use list affected when you want a quick, scannable view of what changed. Use describe affected when you need the complete data structure for automation or detailed analysis.
Example Outputβ
Related Commandsβ
atmos describe affected- Get detailed affected components in JSON/YAML formatatmos list stacks- List all stacksatmos list components- List all componentsatmos list instances- List all component instances