# atmos list vars

Use this command to list component variables across all stacks in a comparison table. View how Terraform variables vary between environments to quickly identify configuration differences and validate consistency.

_\[Video: atmos list vars]_

## Usage

```shell
atmos list vars <component> [flags]
```

## Description

The `atmos list vars` command helps you inspect component variables across different stacks. It provides a tabular view where:

- Each column represents a stack (e.g., dev-ue1, staging-ue1, prod-ue1)
- Each row represents a variable in the component's configuration
- Cells contain the variable values for each stack

This command is an alias for `atmos list values --query .vars` and is useful for:

- Comparing component variables across different environments
- Verifying configuration consistency across stacks
- Troubleshooting configuration issues

## Arguments

- **`component`** — The component to list variables for

## Flags

- **`--query string`** — Filter the results using YQ expressions (default: `.vars`)
- **`--abstract`** — Include abstract components
- **`--max-columns int`** — Maximum number of columns to display (default: `50`)
- **`--format string`** — Output format: `table`, `json`, `yaml`, `csv`, `tsv` (default: `table`)
- **`--delimiter string`** — Delimiter for csv/tsv output (default: `,` for csv, `\t` for tsv)
- **`--stack string`** — Filter by stack pattern (e.g., `*-dev-*`, `prod-*`, `*-{dev,staging}-*`)
- **`--identity` / `-i` (optional)** — Authenticate with a specific identity before listing vars.This is required when stack configurations use YAML template functions(e.g., `!terraform.state`, `!terraform.output`) that require authentication.`atmos list vars vpc --identity my-aws-identity`Can also be set via `ATMOS_IDENTITY` environment variable.
- **`--process-templates`** — Enable/disable Go template processing in Atmos stack manifests (default `true`). Go template functions include `atmos.Component(...)`.Environment variable: `ATMOS_PROCESS_TEMPLATES`
- **`--process-functions`** — Enable/disable YAML functions processing in Atmos stack manifests (default `true`). YAML functions include `!terraform.state`, `!terraform.output`, `!store`, `!aws.*`, etc. This is distinct from Go template functions like `atmos.Component(...)`, which are controlled by `--process-templates`.Environment variable: `ATMOS_PROCESS_FUNCTIONS`

## Examples

List all variables for a component:

```shell
atmos list vars vpc
```

List specific variables using query:

```shell
# List specific variable
atmos list vars vpc --query .vars.tags

# List a nested variable
atmos list vars vpc --query .vars.settings.vpc
```

Filter by stack pattern:

```shell
# List variables for dev stacks
atmos list vars vpc --stack '*-dev-*'

# List variables for production stacks
atmos list vars vpc --stack 'prod-*'
```

Output in different formats:

```shell
# JSON format for machine processing
atmos list vars vpc --format json

# YAML format for configuration files
atmos list vars vpc --format yaml

# CSV format for spreadsheet compatibility
atmos list vars vpc --format csv

# TSV format with tab delimiters
atmos list vars vpc --format tsv
```

Include abstract components:

```shell
atmos list vars vpc --abstract
```

Filter by stack and specific variables:

```shell
atmos list vars vpc --stack '*-ue2-*' --query .vars.region
```

### Custom Column using Stack Name

You can use available variables like `.stack_name` in your column definitions:

```yaml
# In atmos.yaml, under the appropriate scope (values, vars, settings, or metadata)
list:
  columns:
    - name: "Stack"
      value: "{{ .stack_name }}"
    - name: "Variable"
      value: "{{ .key }}"
    - name: "Value"
      value: "{{ .value }}"
```

## Example Output

```shell
> atmos list vars vpc
┌─────────────┬──────────────┬──────────────┬──────────────┐
│             │   dev-ue1    │  staging-ue1 │   prod-ue1   │
├─────────────┼──────────────┼──────────────┼──────────────┤
│ name        │ platform-vpc │ platform-vpc │ platform-vpc │
│ region      │ us-east-1    │ us-east-1    │ us-east-1    │
│ environment │ dev          │ staging      │ prod         │
└─────────────┴──────────────┴──────────────┴──────────────┘
```

:::tip

- For wide tables, try using more specific queries or reduce the number of stacks
- Stack patterns support glob matching (e.g., `*-dev-*`, `prod-*`, `*-{dev,staging}-*`)
- Use `--abstract` to include abstract components in the results
  :::

## Try it out

### demo-stacks

Copy the example into a new directory and make it your own:

```shell
atmos init examples/demo-stacks
cd demo-stacks
```

Compare the myapp variables across the example stacks.

```shell
atmos list vars myapp
```

- [Installation guide](/install)
- [Explore the example](/examples/demo-stacks)
- [Initialization and repository settings](/cli/commands/init#examples-and-source-directories)
