Skip to content

Vibe coding a plugin? 😎 Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

DocumentData

One JSON value a plugin keeps in the open model. It is saved in .modl files and reverts with undo and redo; a new or opened document starts with that document’s value, or none. Values are stored as JSON.stringify writes them, up to 1 MiB.

const count = context.documentData.get() ?? 0;
context.documentData.set(count + 1);

get<T>(): T | undefined

Returns a copy of the plugin’s value in the open model, or undefined when it has none.

T = unknown

T | undefined


set(value): void

Stores the plugin’s value in the open model; undefined removes it. Inside Model.operation the change joins that operation; otherwise it is an undo step of its own. Storing the current value again adds no undo step.

unknown

void