Skip to main content

atmos ci cache paths

Print the resolved cache key, paths, and restore-keys so a native cache (such as GitHub's actions/cache) can do the storage while Atmos supplies what to cache from your ci.cache configuration. Unlike restore/save, this needs no CI provider or runtime token, so it works on any OS and CI system.

Experimental
Configure the CI Cache

The key and paths printed by this command come from the ci.cache section of your atmos.yaml.

atmos ci cache paths

Usage

atmos ci cache paths [flags]

With --format=github, the values are appended to $GITHUB_OUTPUT (as key, path, and restore-keys) so a following actions/cache step can reference them as step outputs.

Examples

# Emit GitHub Actions step outputs (key, path, restore-keys)
atmos ci cache paths --format=github

# Structured output for any other CI or tooling
atmos ci cache paths --format=json
atmos ci cache paths --format=yaml

# Shell-evaluable ATMOS_CI_CACHE_* variables
eval "$(atmos ci cache paths --format=env)"

Use with actions/cache

- name: Resolve Atmos cache key & paths
id: atmos-cache
run: atmos ci cache paths --format=github

- name: Cache Atmos toolchain
uses: actions/cache@v4
with:
key: ${{ steps.atmos-cache.outputs.key }}
path: ${{ steps.atmos-cache.outputs.path }}
restore-keys: ${{ steps.atmos-cache.outputs.restore-keys }}
One-line equivalent

The cloudposse/atmos/actions/cache composite action bundles this paths step and actions/cache into a single uses:.

Flags

--format
Output format: github (default, writes $GITHUB_OUTPUT), json, yaml, or env.
--key / -k
Exact cache key. Defaults to a key derived from the toolchain lockfile plus OS/arch.
--path / -p
Root-relative subpaths to cache. Defaults to the entire cache root. Repeatable.
--root
Override the cache root directory (defaults to the Atmos XDG cache directory, e.g. ~/.cache/atmos).

Environment Variables

ATMOS_CI_CACHE_ENABLED
Must be true (or ci.cache.enabled: true in atmos.yaml) for the command to run.
ATMOS_CI_CACHE_FORMAT
Overrides --format.
ATMOS_CI_CACHE_KEY
Overrides --key.