margot describe
Render the Margo application description as a structured, visual view — rich panels, trees, and tables. Read-only, no schema validation.
margot describe [URI] [--project-dir PATH] [--manifest PATH]
[--section metadata|profiles|config-first|component-first|extensions|orphans]
[--json]
Pass a tagged OCI URI to inspect a published artifact directly, without a local project:
margot describe public.ecr.aws/g2n4p2m7/margo:1.0.0
Flags
| Flag | Default | Description |
|---|---|---|
URI |
— | Optional tagged OCI reference. Selects remote mode. |
--project-dir |
. |
Project directory. Local mode only. Without margo.yaml, reads app.yaml. |
--manifest |
resolved from margo.yaml |
Explicit app.yaml or app.yaml.jinja path. Local mode only. |
--section |
all default sections | Filter to one or more sections. Multiple --section flags are allowed. |
--json |
off | Print selected sections as one JSON object instead of Rich panels and trees. |
Local mode vs remote mode
No URI (local mode): reads the descriptor from the local project — --manifest if given, otherwise resolved
from margo.yaml in --project-dir. This is the default and existing behavior, unchanged.
URI supplied (remote mode): pulls the published Margo artifact into a temporary directory, runs the same
descriptor pipeline, then discards the temporary files. The URI is a full tagged OCI reference, for example
public.ecr.aws/g2n4p2m7/margo:1.0.0. An oci://-prefixed URI is also accepted.
Mutual exclusion: a URI cannot be combined with an explicitly supplied --project-dir or --manifest.
Passing both is rejected before any I/O:
URI and --project-dir/--manifest are mutually exclusive — describe or verify either a remote artifact or a local project, not both.
Remote mode behavior
- Validates the URI syntax and checks registry credentials.
- Fetches the OCI manifest and requires the artifact to be a Margo application artifact
(
application/vnd.margo.app.v1+json). Compose, quadlet, and unknown artifact types are rejected with a clear error directing tomargot fetch <uri>for raw-manifest inspection. - Accepts any existing OCI tag — no SemVer requirement for read-only inspection.
- Pulls the artifact into a temporary directory (
recursive=False— component artifacts are not recursively downloaded). The pull is non-persistent; nothing is written to your project directory. The descriptor layer is located bymediaType == application/vnd.margo.app.description.v1+yaml— not by filename. If multiple layers share that media type, a warning lists them and the first (manifest order) is used. - Passes the pulled descriptor through the same local descriptor pipeline: YAML parsing,
kindgate, configuration joins, orphan observations, and rich rendering. - Removes the temporary directory after rendering, including on error.
The identity panel identifies the remote source:
- Subtitle:
<uri> (remote) - OCI line: the same normalized URI
Descriptor resolution (local mode)
--manifestif given — may point atapp.yamlorapp.yaml.jinja.- Otherwise, if
margo.yamlis present in--project-dir: itsdirectoryfield is searched forapp.yaml.jinja(rendered to a temp file) orapp.yaml. Never reads<build_dir>, never requires a priorbuild. - Otherwise (no
margo.yaml): fallback search for a staticapp.yaml, directory by directory,<project-dir>first, then<project-dir>/margo. In each directory,app.yamlis used if present; otherwise anapp.yaml.jinjathere is an error and the search stops (it does not continue to the next directory, so a rootapp.yaml.jinjafails even ifmargo/app.yamlexists). No project context is available in this mode — same as--manifest. - A
.jinjafile at a candidate location (withoutmargo.yaml) fails with exit 3:Found <path> but no margo.yaml is present. Jinja2 templates require margo.yaml context for rendering — either provide a static app.yaml or add margo.yaml to the directory. - Neither location has an
app.yaml(exit 3):No app.yaml found. Searched: <both paths>
This fallback makes it possible to run describe directly on a directory produced by
margot pull, with no margo.yaml required.
Sections rendered
Sections always appear in this order. --section filters which are shown; it never
reorders them.
metadata — identity and catalog
apiVersion as the panel title, id, metadata.version and metadata.name as a grid,
the artifact OCI URI (OCI: {repository}:{tag}, or OCI: None), then Description: and
Catalog: blocks. Panel subtitle shows the resolved descriptor path, marked (rendered)
when from app.yaml.jinja.
profiles — deployment profiles
One tree per profile: type and id, description, requiredResources, then
components[] → properties. Panel title shows a count (7 profiles · 9 components).
config-first — configuration (default view)
A single tree walked top-down from configuration sections:
section → setting (+ immutable) → Schema: <name> <dataType> · <constraints>
→ Parameter: <name> → Default: <value>
→ Pointer: <p> (n/total)
→ components
Parameters that no Setting references appear in a trailing subtree. Panel title shows
a count (6 sections · 22 settings).
component-first — components (not in default view)
An alternative configuration view walked component-first: each component lists its incoming parameters (via their pointers) with their values, setting names, and schemas. Useful for understanding what a specific component needs to configure.
Request with --section component-first.
extensions — x-placeholder-extensions
Rendered only when present in the descriptor.
orphans — coherence checks (not in default view)
Four categories of dangling or unreferenced descriptor elements:
- Unreferenced parameters: a
Parameternot referenced by anySetting. - Unresolved schema references: a
Settingwhoseschemaname doesn't resolve to a declared schema. - Unreferenced schemas: a
Schemadeclared but not referenced by anySetting. - Dangling component references: a
Parameter.targets[].componentsentry naming a component absent from all deployment profiles.
These are observations only and do not affect the exit code. Descriptor loading and semantic failures still fail the
command; use margot verify for the full schema validation gate.
Request with --section orphans.
JSON output
Pass --json to replace Rich panels and trees with one JSON object on stdout. The object contains the selected
sections as keys in canonical order. The default keys are metadata, profiles, and config-first; extensions
is included by default when x-placeholder-extensions is present. component-first and orphans remain opt-in
through --section, just as in Rich mode.
The values reuse the pure display data: metadata contains identity and catalog, profiles is a list of
profile objects, config-first and component-first use their corresponding display-model structures, and
orphans contains its four report lists. extensions contains the descriptor's extension mapping. For example:
{
"metadata": {
"identity": {
"id": "hello-world",
"api_version": "application.margo.org/v1alpha1",
"kind": "ApplicationDescription",
"name": "Hello World",
"version": "1.0.0",
"description": null,
"oci_uri": null
},
"catalog": null
},
"profiles": [],
"config-first": {
"sections": [],
"unreferenced": []
}
}
--section may be repeated with --json; requested sections are still emitted in canonical order.
When descriptor loading or semantic interpretation fails with --json, no Rich panels or prose are emitted. The
command writes an error envelope to stderr and exits with the stable category code:
{"error": true, "code": 3, "message": "..."}
The envelope uses code 2 for URI/local option conflicts, 3 for descriptor or semantic failures, 4 for remote
or authentication failures, and 1 for unexpected failures. Successful JSON output is written to stdout.
Rendering notes
Values are rendered in literal form: strings quoted, numbers and booleans bare, "" for
empty string, — for absent. Nothing is truncated or elided; long values word-wrap.
Descriptor text is escaped before printing, so array[string] and [Container] render
literally rather than being parsed as rich markup.
type and component properties keys are printed verbatim — no enum check, no fixed
property lookup. This is deliberate: margot supports quadlet profiles ahead of the
upstream spec, and the spec's property set is still in flux.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Descriptor loaded and rendered/serialized successfully. Orphan observations do not affect this code. |
| 1 | Unexpected or uncategorized failure. |
| 2 | Usage failure, such as combining a remote URI with --project-dir or --manifest. |
| 3 | Descriptor loading or semantic failure: missing descriptor, both descriptor forms present, Jinja2 template found without margo.yaml, unresolved template, invalid YAML, or wrong kind. |
| 4 | Remote registry or authentication failure, including an HTTP error status from the registry (for example 429, a 5xx, or a 404 for a missing tag). |
On a descriptor failure, the error message points at margot verify.
Example
# Describe the application descriptor in the current project
margot describe
# Inspect a published artifact from a registry
margot describe public.ecr.aws/g2n4p2m7/margo:1.0.0
# Pull an artifact, then inspect locally — no margo.yaml required
margot pull public.ecr.aws/g2n4p2m7/margo:1.0.0 --output ./out
margot describe --project-dir ./out
# Remote mode respects all --section filters and ordering
margot describe public.ecr.aws/g2n4p2m7/margo:1.0.0 --section metadata --section profiles
# Show only the identity and deployment profiles (local)
margot describe --section metadata --section profiles
# Show the component-first configuration view
margot describe --section component-first
# Show orphan/dead-end checks
margot describe --section orphans
# Describe a specific manifest file
margot describe --manifest path/to/app.yaml
See a real multi-component example: Full example — Inspect with describe.