Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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]
FlagDescription
--typeRequired. Type identifier.
--idRequired. Object identifier to update. For entities that use identifier: $path, this is the workspace-relative file path.
--fileOptional path to a YAML/JSON payload (defaults to STDIN).
--mergeMerge 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.