Reference

Commands

Every command, for keymaps and agents.

Commands are pure functions (state, params) → Edit. Run them with runCommand(state, name, params) or as agent tools; every command also accepts target.

CommandParamsDescription
toggleMarkmark (bold | italic | code | strike)Toggle bold (**), italic (_), code (`) or strikethrough (~~) around the selection or the word at the cursor.
setHeadinglevelSet the heading level of the selected lines. Level 0 makes them paragraphs.
toggleListkind (bullet | ordered | task)Toggle a bullet, ordered or task list on the selected lines.
toggleTaskcheckedCheck or uncheck the task items in the selection.
toggleQuote–Toggle a blockquote on the selected lines.
insertLinkurlWrap the selection in a Markdown link.
insertComponentname, props, content, inlineInsert a block (or inline) component at the selection. The selection becomes its content.
wrapComponentname, propsWrap the selected lines in a block component (nesting colons are added as needed).
unwrapComponent–Remove the component at the cursor and keep its content.
setPropspropsSet or remove (value null) attributes of the component at the cursor.
propsToYaml–Move the attribute block of the component at the cursor into a YAML props block.
setFrontmatterkey, valueSet a top-level frontmatter key (value null removes it). Creates the frontmatter when missing.
formatTable–Align the columns of the table at the cursor.
insertFootnotecontent, idInsert a footnote reference at the cursor and its definition at the end of the document.
applyPunctuation–Replace straight quotes, --, --- and ... with typographic characters in prose (selection, or the whole document).
Copyright © 2026