# atmos version track lock

Resolve your declared dependency versions and record the results in `versions.lock.yaml`. Use this
command to establish concrete version pins before applying them to project files.

`lock` resolves each entry's `desired` expression as-is; use [`update`](/cli/commands/version/track/update) to advance existing locks within policy.

When an entry's effective policy sets `pin: digest` or `pin: sha`, locking also resolves the immutable identifier: a git commit SHA for GitHub datasources or a `sha256:` manifest digest for OCI registries.

## Usage

```shell
atmos version track lock [track] [flags]
```

## Flags

- **`--group`** — Limit locking to entries in the named version group.
- **`--format string`** — Output format: `table`, `json`, `yaml`, `csv`, `tsv` (default: `table`)

## Examples

```shell
# Bootstrap the lock file for the prod track
atmos version track lock prod

# Re-resolve only the infrastructure group
atmos version track lock prod --group=infrastructure
```

## Example Output

In an interactive terminal, `--format=table` (the default) renders a styled table scoped to the
resolved track's entries. Use `--format=csv` or `--format=tsv` for delimited output; piped table
output remains a table.

```shell
> atmos version track lock prod --format=csv
Track,Name,Version,Ecosystem,Digest,Resolved At
prod,checkout,v6.1.0,github-actions,8edcb1bdb4e267140fa742c62e395cd74f332709,2026-07-04T00:00:00Z
prod,nginx,1.29.0,docker,,2026-07-04T00:00:00Z
```

Use `--format=yaml` or `--format=json` for the full multi-track `versions.lock.yaml` contents,
rather than just the resolved track's entries.

## Try it out

### version-tracker

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

```shell
atmos init examples/version-tracker
cd version-tracker
```

Write the dev track lock using the concrete versions in the example. No cloud credentials are needed.

```shell
atmos version track lock dev
```

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