# atmos artifacts catalog sync

Resolve the releases of an inventory and merge them into the latest published catalog. Entries the inventory does not mention are kept, so sync is safe to run on a schedule.

> ⚠️ Experimental

## Usage

```shell
atmos artifacts catalog sync --repository=<alias> --input=<inventory> [flags]
```

## Examples

```shell
# Merge an inventory into the published catalog
atmos artifacts catalog sync --repository=shared --input=inventory.yaml
```

## Behavior

Sync takes the repository's lock when it provides one, reads the latest catalog, resolves each inventory ref, merges the releases, and publishes a new revision. A listed version whose tag now resolves to a different digest is updated and reported under `updated`. Nothing is removed: use [`remove`](/cli/commands/artifacts/catalog-remove) to unlist a release.

## Flags

- **`--repository`, `-r` (required)** — Configured repository alias the inventory refs are relative to. Its `catalog` setting selects the catalog.
  Environment variable: `ATMOS_ARTIFACTS_REPOSITORY`
- **`--input` (required)** — An `AtmosArtifactInventory` manifest listing the releases to merge.
  Environment variable: `ATMOS_ARTIFACTS_INPUT`
- **`--format` (optional)** — Output format: `text` (default), `json`, or `yaml`.
  Environment variable: `ATMOS_ARTIFACTS_FORMAT`

## Errors

- **Catalog not configured** — The repository has no `catalog`. Nothing is written.
- **Reference not found** — An inventory ref does not resolve in the repository. Nothing is written.
- **Catalog changed** — Another writer published between the read and the write. Run the command again, and run only one catalog writer at a time.

Every failure exits with a nonzero status.

## Related

- [`atmos artifacts catalog build`](/cli/commands/artifacts/catalog-build)
- [`atmos artifacts catalog add`](/cli/commands/artifacts/catalog-add)
- [Artifacts Configuration](/cli/configuration/artifacts)
