Skip to main content
Version: v5.7.0

opschain metadata annotate

Included from Basic tier

opschain metadata annotate --scope <selector> [--kind <kind>]... [--where <predicate>]... <field>=<value> ... [--clear <field>]...

Bulk-applies metadata writes to every node a selector covers (MetadataService.BulkAnnotate) — the existing-estate adoption path. Coverage is the scope selector (the path-glob grammar) AND the kind filter AND every --where predicate, evaluated against EFFECTIVE values; nodes the caller cannot read are not covered, and covered nodes to which no written field applies are skipped and counted. Values are typed by the profile schema exactly as metadata set types them; each write is audited per node. Needs the metadata-writer determination over the scope's literal prefix; writing a protective field requires a stepped-up session.

The --where grammar: <field>=<value> (equality), <field> in <v1>,<v2> (membership), <field> is true|false (bool tests), <field> is unclassified — how absence is selected ("classify everything still unclassified"); an unset field otherwise matches nothing — and, for date fields, <field> before <YYYY-MM-DD> / <field> after <YYYY-MM-DD> (strict comparison against a fixed date) and <field> is elapsed (the date is in the past at evaluation time). A value that is not a date matches none of the date ops.

-o json / -o yaml emit the annotated/skipped counts.

Flags​

FlagMeaning
--scope <selector>The node-path selector to cover (** any depth, */?/[ per segment; / covers the whole estate).
--kind <kind>Keep only nodes of this kind: project, environment, asset, infrastructure or entity (repeatable; default all). An unknown kind is refused before calling the server.
--where <predicate>A metadata predicate every covered node must match (repeatable; predicates AND).
--clear <field>Clear this field's own value on every covered node (repeatable).

Exit codes​

CodeMeaning
0Applied; the output reports annotated and skipped node counts.
1Refused — no metadata-writer determination over the scope, an unelevated protective write, or an invalid selector/predicate (named by the server).
2Usage error — no writes supplied, a malformed --where, an unknown --kind (invalid --kind "…" (must be project, environment, asset, infrastructure or entity)), or a missing server target.