Skip to main content

mr note-block create

Create a new block attached to a Note. --note-id and --type are required. Use --content to supply the block's content JSON (the exact shape depends on the chosen type — see note-block types for the default content schema of each built-in type). --position is optional; when omitted the server assigns a position after the current last block. The created record is returned; capture .id from JSON output for use in follow-up commands.

Usage

mr note-block create

Examples

Create a text block on note 42

mr note-block create --note-id 42 --type text --content '{"text":"hello"}'

Create a heading block with an explicit position

mr note-block create --note-id 42 --type heading --content '{"text":"Intro","level":2}' --position a

Flags

FlagTypeDefaultDescription
--note-iduint0Note ID (required) (required)
--typestring``Block type (required) (required)
--contentstring{}Block content JSON
--positionstring``Block position

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

Created NoteBlock object with id (uint), noteId (uint), type (string), position (string), content (object), state (object)

Exit Codes

0 on success; 1 on any error

See Also