# atmos profile list

Use this command to list all configured profiles across all discovery locations with their details.

## Usage

```bash
atmos profile list [flags]
```

## Description

List all configured profiles across all locations with their details.

Profiles are discovered from multiple locations in precedence order:

1. **Configurable path**: `profiles.base_path` in `atmos.yaml`
2. **Project-hidden**: `.atmos/profiles/`
3. **XDG user directory**: `~/.config/atmos/profiles/` (or `$XDG_CONFIG_HOME/atmos/profiles/`)
4. **Project directory**: `profiles/`

The output includes:

- Profile name
- Source location
- Description (if available)

## Flags

- **`-f, --format`**

  Output format. Options: `table`, `json`, `yaml`

  **Default:** `table`

## Examples

### List All Profiles

```bash
# List all available profiles in table format (default)
atmos profile list
```

**Example output:**

```
┌────────────┬────────────────────────────────┬─────────────────────────────────┐
│ NAME       │ SOURCE                         │ DESCRIPTION                     │
├────────────┼────────────────────────────────┼─────────────────────────────────┤
│ developer  │ profiles/developer             │ Development environment         │
│ ci         │ profiles/ci                    │ CI/CD pipeline settings         │
│ production │ profiles/production            │ Production configuration        │
│ debug      │ ~/.config/atmos/profiles/debug │ Debug logging enabled           │
└────────────┴────────────────────────────────┴─────────────────────────────────┘
```

### Output as JSON

```bash
# List profiles in JSON format for scripting
atmos profile list --format json
```

**Example output:**

```json
[
  {
    "name": "developer",
    "source": "profiles/developer",
    "description": "Development environment"
  },
  {
    "name": "ci",
    "source": "profiles/ci",
    "description": "CI/CD pipeline settings"
  }
]
```

### Output as YAML

```bash
# List profiles in YAML format
atmos profile list --format yaml
```

**Example output:**

```yaml
- name: developer
  source: profiles/developer
  description: Development environment
- name: ci
  source: profiles/ci
  description: CI/CD pipeline settings
```

### Using the Alias

You can also use the `atmos list profiles` alias:

```bash
# List profiles using the alias
atmos list profiles

# With format flag
atmos list profiles --format json
```

## Scripting Examples

### Check if a Profile Exists

```bash
# Check if 'developer' profile exists
if atmos profile list --format json | jq -e '.[] | select(.name == "developer")' > /dev/null; then
    echo "Developer profile found"
    atmos --profile developer terraform plan vpc -s dev
fi
```

### List Profile Names Only

```bash
# Get just the profile names
atmos profile list --format json | jq -r '.[].name'
```

### Count Available Profiles

```bash
# Count total profiles
atmos profile list --format json | jq 'length'
```

## See Also

- [`atmos profile`](/cli/commands/profile/usage) - Profile management overview
- [`atmos profile show`](/cli/commands/profile/profile-show) - Show profile details
- [Global Flags](/cli/global-flags) - Using the `--profile` flag
