Skip to main content
Version: v5.7.0

opschain artifacts get

Included from Basic tier

Fetches one artifact's content, two addressing modes:

opschain artifacts get <code> --node <path> [--label <label>]...
opschain artifacts get --id <artifact-id>
  • Latest-matching (--node + <code>, optionally narrowed by --label) resolves the newest artifact with that identity. Against a server the resolution is performed server-side (GET /api/artifacts/load — the node path resolves to its row id first): the newest live match by (created_at desc, id desc) streams back; when every matching version has been purged by retention the error names the tombstone; no match is a named not-found pointing at artifacts list --node. Locally the store applies the same rule.
  • Exact id (--id) downloads exactly that artifact over the server API (GET /api/artifacts/<id>/download) — deterministic against re-publishes and verified against its recorded digest; use it when another run or trigger hands you an artifact id. A server target is required.

The content streams to stdout, or to --out; with --out a summary line (wrote artifact …) goes to stderr unless --quiet.

Flags​

FlagMeaning
--node <path>Node path the artifact was stored against (required unless --id).
--label <label>Label the artifact must carry (repeatable). Comma-separated values also split.
--out <file>Write the content to this file instead of stdout.
--id <artifact-id>Fetch exactly this artifact id (server target required). Mutually exclusive with <code>, --node and --label.

Exit codes​

CodeMeaning
0Content delivered.
1Resolution or download failed (e.g. artifact download answered <status>).
2Usage error.

Named errors​

  • --id fetches exactly one artifact — drop <code>, --node and --label
  • <code> is required (or use --id)
  • --node is required
  • <path> is an entity — an entity has no template and nothing runs against it, so it cannot hold artifacts — an entity path as --node
  • --id in local mode fails with artifacts need a server target — pass --server <url> or 'opschain context use <name>' (local mode has no artifacts)

All exit 2. Exit-1 resolution errors: no artifact matching code "…" at <node> found (pointing at artifacts list --node), and the latest artifact matching … has been purged by retention — its content is no longer available.

Examples​

Latest artifact of a code at a node (local or server target):

opschain artifacts get tfplan --node /projects/demo/environments/dev --out tfplan.bin

Exact fetch of a handed-off id from a server:

opschain artifacts get --id 01999a7e-3c2d-7e50-a9a1-2b7c7f6f4242 --out release.tgz

See also​

  • opschain docs cli/artifacts-list — find codes, labels and ids.
  • opschain learn 5.7 — the artifact hand-off pattern.