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
| Flag | Meaning |
|---|---|
--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 or asset (repeatable; default all). |
--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
| Code | Meaning |
|---|---|
| 0 | Applied; the output reports annotated and skipped node counts. |
| 1 | Refused — no metadata-writer determination over the scope, an unelevated protective write, or an invalid selector/predicate (named by the server). |
| 2 | Usage error — no writes supplied, a malformed --where, or a missing server target. |