Synopsis: Modify an existing object. You can replace the object entirely or merge in a subset of fields.
Usage
mergeway-cli [global flags] update --type <type> --id <id> [--file path] [--merge]
| Flag | Description |
|---|---|
--type | Required. Type identifier. |
--id | Required. Object identifier to update. For entities that use identifier: $path, this is the workspace-relative file path. |
--file | Optional path to a YAML/JSON payload (defaults to STDIN). |
--merge | Merge fields into the existing object instead of replacing it. |
Example
Run the command from the workspace root (or add --root to target another workspace). Update a post title by merging in a tiny payload:
cat <<'PAYLOAD' > post-update.yaml
title: Launch Day (Updated)
PAYLOAD
mergeway-cli update --type Post --id post-001 --file post-update.yaml --merge
Output:
Post post-001 updated
Run mergeway-cli validate after significant updates to confirm references still resolve. Without --merge, the payload replaces the entire object.
For entities that use identifier: $path, pass the workspace-relative file path to --id, for example mergeway-cli update --type Note --id data/notes/alpha.yaml --file note.yaml --merge.
If the resolved record lives outside the workspace root, update rejects it. External-root $path records are intentionally read-only through the CLI even though they can still be listed, fetched, validated, and exported.
Related Commands
mergeway-cli create— add new objects.mergeway-cli delete— remove objects that are no longer needed.