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

mw create

Last updated: 2025-10-22

Synopsis: Create a new object file that conforms to an entity definition.

Usage

mw [global flags] create --type <type> [--file path] [--id value]
FlagDescription
--typeRequired. Type identifier to create.
--fileOptional path to a YAML/JSON payload. If omitted, data is read from STDIN.
--idOptional identifier override. Useful when the payload omits the id field.

Example

Run the command from the workspace root (or pass --root if you are elsewhere). Create a user by piping a YAML document and letting Mergeway write the file under data/users/:

cat <<'PAYLOAD' > user.yaml
name: Bob Example
PAYLOAD

mw create --type User --file user.yaml --id user-bob

Output:

User user-bob created

The command writes data/users/user-bob.yaml with the provided fields. Remove the temporary user.yaml file afterward and run mw validate to confirm the new object passes checks.



Generated at 2025-10-30 22:44:13 (commit: 3a1f254)