# !repo-root

The `!repo-root` Atmos YAML function is used to retrieve the root directory of the Atmos repository.

## Availability and evaluation

Supported locations:

- **CLI configuration** (`atmos.yaml`, `atmos.d`, and profiles): during configuration loading.
- **Resolved stack values**: after inheritance, merging, and component template processing.
- **Scaffold manifests**: during manifest loading.

Automatic evaluation requires native YAML tags from edition `2026-10-20`, including unpinned projects. Quoted function strings remain literal; earlier editions retain legacy string-form behavior.

See [YAML function scope](/functions/yaml/scope) for field restrictions, import timing, and native tags versus quoted strings.

## Usage

The `!repo-root` function can be called with default value:

```yaml
  # Get the root directory of the Atmos repository.
  # If the Git root is not found, it will return a default value if specified; otherwise, it returns an error.
  `!repo-root <default-value>`
```

## Examples

```yaml
vars:
  # `base_path` will be set to the root directory of the Atmos repository if present otherwise it will return an error
  base_path: !repo-root
```

```yaml
vars:
  # `base_path` will be set to the default value `default-value` if the Atmos repository root is not present
  base_path: !repo-root <default-value>
```

## Related Functions

- [`!git.root`](/functions/yaml/git.root) — an alias of `!repo-root`, kept for naming-convention consistency with
  the other `!git.*` functions
