CLI reference

Commands

ocync sync -c config.yaml               Sync images from config
ocync sync -c config.yaml --dry-run     Preview what would sync
ocync sync -c config.yaml --json        Output sync report as JSON
ocync copy <source> <destination>       Copy a single image
ocync tags <repository>                 List and filter tags
ocync watch -c config.yaml              Continuous sync on a schedule
ocync analyze -c config.yaml            Analyze blob sharing potential
ocync auth check -c config.yaml         Verify registry credentials
ocync validate config.yaml              Validate config without connecting
ocync expand config.yaml                Show config with env vars resolved
ocync version                           Print version and build info

Global options

FlagDescription
-v / --verboseIncrease log verbosity (-v debug, -vv or higher trace)
-q, --quietSuppress all output except errors
--log-formatSet log format: text (default) or json (auto-detected in Kubernetes)

sync

Sync images defined in a config file:

ocync sync -c config.yaml
ocync sync -c config.yaml --dry-run
ocync sync -c config.yaml --json
FlagDescription
-c, --configPath to sync config file (required)
--dry-runPreview what would sync without making changes
--jsonOutput sync report as JSON to stdout

copy

Copy a single image between registries:

ocync copy cgr.dev/chainguard/nginx:latest \
    123456789012.dkr.ecr.us-east-1.amazonaws.com/nginx:latest
ArgumentDescription
<source>Source image reference with tag (required)
<destination>Destination image reference (required)

The source reference must include a tag. The destination tag defaults to the source tag if omitted.

tags

List and filter tags for a repository:

ocync tags docker.io/library/nginx
ocync tags cgr.dev/chainguard/nginx --semver ">=1.0" --latest 10
FlagDescription
-c, --configConfig file for registry credentials (optional)
--globInclude tags matching a glob pattern (repeatable)
--semverInclude tags matching a semver range (e.g., >=1.0, <2.0)
--excludeExclude tags matching a pattern (repeatable)
--sortSort order: semver or alpha
--latestShow only the N most recent tags

watch

Continuous sync on a schedule with health endpoints:

ocync watch -c config.yaml --interval 600 --health-port 8080
FlagDefaultDescription
-c, --config(required)Path to sync config file
--interval300Seconds between sync runs (minimum: 1)
--health-port8080Port for /healthz and /readyz endpoints
--health-bind127.0.0.1IP for the health endpoint to bind on. Set to 0.0.0.0 for container hosts where probes originate externally
--jsonOutput sync reports as JSON

See observability for health endpoint details.

analyze

Analyze blob sharing and cross-repo mount potential without performing a sync. Pulls source manifests only (no blobs transferred) and reports total unique blobs, shared blobs across images, deduplicated bytes saved, and per-target mount opportunities.

ocync analyze -c config.yaml
ocync analyze -c config.yaml --json
FlagDescription
-c, --configPath to sync config file
--jsonEmit a JSON report instead of text summary

Use analyze to estimate transfer savings before running a full sync, or to verify that blob deduplication and mounting are configured correctly.

validate

Validate a config file without connecting to registries:

ocync validate config.yaml
ArgumentDescription
<config>Path to the config file to validate (required)

Checks config syntax, structure, and references (registry names, target groups) without making any network requests. Catches errors before attempting a sync. Exits with code 0 on success or 3 on invalid configuration.

expand

Show config with all environment variables resolved:

ocync expand config.yaml
ocync expand config.yaml --show-secrets
FlagDescription
--show-secretsShow credential values instead of redacting them. Do not use when stdout is piped to a file or logging system

auth check

Verify registry credentials for all registries in a config:

ocync auth check -c config.yaml
ocync auth check -c config.yaml -c config2.yaml
FlagDescription
-c, --configPath to config file (required, repeatable for multiple configs)

Exit codes

CodeMeaning
0All images synced or skipped
1Partial failure (some images failed)
2All images failed or unclassified error
3Invalid configuration
4Authentication or authorization failure

Structured output

Use --json to get machine-readable sync reports for CI/CD pipelines:

ocync sync -c config.yaml --json

The JSON output includes per-image results, aggregate statistics (blobs transferred, bytes, mounts, cache hits), and any errors encountered.

Environment variables

VariableDescription
AWS_REGIONAWS region for ECR auth
AWS_USE_FIPS_ENDPOINTUse FIPS endpoints for ECR
DOCKER_CONFIGDocker config directory (default: ~/.docker)
RUST_LOGLog filter directive (overrides -v flags)
NO_COLORDisable colored output