opschain properties edit
Included from Basic tier
opschain properties edit <node-path> -f <doc.json|yaml> [--base-version N]
Replaces a server node's stored properties data with the -f file's
document, which becomes the new version wholesale — this is a replace,
not a merge, so fetch the current data with opschain properties show
first, edit it, and submit the whole document. The file is a JSON or YAML
object (YAML is a superset, so one decoder reads both). Server-only: pass
--server <url> or select a context with opschain context use.
The write is versioned compare-and-set: the command reads the document's
current version and PATCHes against it, so an edit that lands in between
surfaces the server's named version-mismatch error instead of silently
clobbering it — re-fetch, reapply your change and retry. --base-version
skips the read and asserts the edit was made against that exact version;
a stale value surfaces the same version-mismatch error.
Old versions are retained — see opschain properties history.
Flags
| Flag | Meaning |
|---|---|
-f, --file <file> | The document's new data, a JSON or YAML object (required; replaces the stored data wholesale). |
--base-version N | The version the edit was made against (skips the read; a stale value surfaces the server's version-mismatch error). |
Output
opschain properties edit demo/environments/dev -f properties.json
updated properties of demo/environments/dev: version 4 → 5
With -o json / -o yaml, the new document (path, id, version,
created_at, data).
Exit codes
| Code | Meaning |
|---|---|
| 0 | New version written. |
| 1 | Version mismatch, missing node/document, authorisation, or the request failed. |
| 2 | Usage error. |
Named errors
-f is required — the file holds the document's new data(exit 2).<path>: the properties data must be a JSON or YAML object: <cause>(exit 2).stored properties documents live on a server's nodes — pass --server <url> or 'opschain context use <name>'(exit 2).<node-path> has no stored properties document on this server.- A lost compare-and-set race surfaces the named conflict —
the document changed while you edited it (your edit was based on version N; the server now holds version M) — re-run the edit(exit 1).
See also
opschain docs cli/properties-show— fetch the current data to edit.opschain docs cli/properties-history— the version trail every edit appends to.opschain learn 1.3— properties and settings, guided.