margot pull
Pull OCI artifact layers to a local directory without extraction.
margot pull <uri> [--output DIR] [--recursive]
Arguments
| Argument | Description |
|---|---|
<uri> |
Full OCI reference: registry/repository:tag. Example: public.ecr.aws/g2n4p2m7/margo:1.0.0 |
Flags
| Flag | Default | Description |
|---|---|---|
--output / -o |
. (current directory) |
Directory to write pulled layers into. |
--recursive / -r |
off | Pull declared components too (margo artifacts only). |
What it does
pull fetches and writes artifact layers to disk exactly as stored — no extraction, no
modification. .tgz blobs land as .tgz files.
No SemVer validation: pull retrieves arbitrary existing artifacts. Credentials stored
by margot auth login are used automatically for private registries; public registries
work without login.
Logic
- Validate the URI format.
- Fetch the manifest.
- Detect artifact type from the
artifactTypemanifest field:application/vnd.margo.app.v1+json→ margoapplication/vnd.org.margo.component.compose+json→ composeapplication/vnd.org.margo.component.quadlet+json→ quadlet- anything else → unknown
- Pull all layers to
--output. - For compose/quadlet: rename the payload file using the layer's
org.opencontainers.image.titleannotation, or<title>-<version>.tgzfrom manifest annotations, when available. - Report each written file path.
Recursive pull (--recursive)
Only applies to margo artifacts. Has no effect on compose, quadlet, or unknown artifacts.
When --recursive is set for a margo artifact:
- Locate the descriptor layer by
mediaType == application/vnd.margo.app.description.v1+yamlin the manifest — not by filename. If multiple layers share that media type, a warning names them and the first (manifest order) is used. - Parse
deploymentProfiles[].components[]to extract component OCI references:properties.repository(stripoci://scheme) +properties.revision→ OCI ref. Components missing either field are skipped with a warning. - Deduplicate by
(repository, tag), preserving first-seen order. - Pull each component into
--output/<component-name>/.
If the descriptor layer cannot be found, parsed, or a component pull fails, a warning is logged but the root pull succeeds.
Recursive output structure
outdir/
app.yaml
database/
postgres-14.0.0.tgz
cache/
redis-7.0.0.tgz
Exit codes
| Code | Meaning |
|---|---|
| 0 | Pull succeeded (including partial recursive pulls with component warnings). |
| 1 | Unexpected failure. |
| 3 | Malformed or invalid URI, or other semantic input failure. |
| 4 | Registry or authentication failure: denied access (401 or 403), credentials missing or expired, or another HTTP error status such as 429, a 5xx, or a 404 for a missing tag. |
Example
# Pull a margo artifact to the current directory
margot pull public.ecr.aws/g2n4p2m7/margo:1.0.0
# Pull into a specific directory
margot pull public.ecr.aws/g2n4p2m7/margo:1.0.0 --output ./out
# Pull a margo artifact and all its declared components
margot pull public.ecr.aws/g2n4p2m7/margo:1.0.0 --output ./out --recursive
# Pull a compose component
margot pull public.ecr.aws/g2n4p2m7/margo:1.0.0_compose-default --output ./components