Skip to main content

Actions Reference

Every CodeVideo project is a list of actions. Each action is a { "name": "...", "value": "..." } object: the name says what happens, the value says what to do it with. Send a list of them to the API (see the Quick Start) or render them locally with the CLI.

Use the table of contents to jump to a domain, or link to an action directly, e.g. /actions#editor-type.

Author​

What the narrator says, and pauses between steps.

author-speak-before

Shows the value as a caption, speaks it, and waits for the speech to end before the next action.

Value: The content the author speaks before.

author-speak-after

Same as author-speak-before: shows the caption, speaks, and waits before the next action. Use author-speak-before instead.

Value: The content the author speaks.

author-speak-during

Starts speaking and goes straight on to the next actions without waiting for the speech to end. Prefer author-speak-before.

Value: The content the author speaks.

author-wait

Author waits for given amount of time in milliseconds.

Value: The amount of time to wait in milliseconds.

Editor​

Typing, keystrokes, selection, scrolling, the context menu and TypeScript squiggles in the editor.

editor-type

Types into the active editor: the file last created with the mouse or opened with file-explorer-open-file.

Value: The text to type, including newlines.

editor-save

Saves the active editor. Compile checks and file reads only see saved text, so save after typing.

Value: Always '1'.

editor-arrow-up

Move the editor caret up one row.

Value: The number of rows to move up.

editor-arrow-down

Move the editor caret down one row.

Value: The number of rows to move down.

editor-arrow-left

Move the editor caret left one column.

Value: The number of columns to move left.

editor-arrow-right

Move the editor caret right one column.

Value: The number of columns to move right.

editor-enter

Press the Enter key in the editor.

Value: The number of times to press Enter.

editor-tab

Press the Tab key in the editor.

Value: The number of times to press Tab.

editor-shift+arrow-left

Hold Shift and move the editor caret left.

Value: The number of columns to move left.

editor-shift+arrow-right

Hold Shift and move the editor caret right.

Value: The number of columns to move right.

editor-shift+arrow-down

Hold Shift and move the editor caret down.

Value: The number of rows to move down.

editor-shift+arrow-up

Hold Shift and move the editor caret up.

Value: The number of rows to move up.

editor-cmd+d

Press Cmd+D in the editor.

Value: The number of times to press Cmd+D.

editor-backspace

Press the Backspace key in the editor.

Value: The number of times to press Backspace.

editor-space

Press the Space key in the editor.

Value: The number of times to press Space.

editor-highlight-code

Not supported yet: the IDE and the renderer ignore it, so nothing happens. To point at code, bring its file forward with mouse-move-editor-tab and talk about it.

Value: The code to highlight.

editor-delete-line

Delete the current line in the editor.

Value: The line to delete.

editor-command+shift+arrow-right

Extend selection to the end of the logical line, excluding the newline.

Value: Number of key presses.

editor-command+shift+arrow-left

Extend selection to the absolute start of the logical line, excluding the newline.

Value: Number of key presses.

editor-shift+end

Extend selection to the end of the logical line, excluding the newline.

Value: Number of key presses.

editor-shift+home

Extend selection to the absolute start of the logical line, excluding the newline.

Value: Number of key presses.

editor-command-left

Hold Command and move the editor caret left.

Value: The number of columns to move left.

editor-command-right

Hold Command and move the editor caret right.

Value: The number of columns to move right.

editor-command-d

Hold Command and press D in the editor.

Value: The number of times to press Cmd+D.

editor-command-c

Hold Command and press C in the editor.

Value: The number of times to press Cmd+C.

editor-command-v

Hold Command and press V in the editor.

Value: The number of times to press Cmd+V.

editor-shift-down-arrow

Hold Shift and move the editor caret down.

Value: The number of rows to move down.

editor-shift-up-arrow

Hold Shift and move the editor caret up.

Value: The number of rows to move up.

editor-scroll-up

Scroll the editor up.

Value: The number of pixels to scroll up.

editor-scroll-down

Scroll the editor down.

Value: The number of pixels to scroll down.

editor-show-context-menu

Show the context menu in the editor.

Value: The number of times to show the context menu - should typically be '1'.

editor-hide-context-menu

Hide the context menu in the editor.

Value: The number of times to hide the context menu - should typically be '1'.

editor-show-diagnostics

Turns on TypeScript squiggles (red errors, yellow warnings) for the rest of the lesson, or until editor-hide-diagnostics. They update each time an action that changed a file finishes, not per keystroke, so a typo shows once its editor-type ends.

Value: Always '1'.

editor-hide-diagnostics

Turns TypeScript squiggles off again.

Value: Always '1'.

TypeScript squiggles​

Squiggles are off unless you ask for them, so existing projects render exactly as before. Turn them on for the whole video with the isDiagnosticsVisible option, or for part of a lesson with editor-show-diagnostics and editor-hide-diagnostics. To show an error's message the way VS Code does, move the mouse onto it with mouse-move-editor-diagnostic. Its value is the active file's path, line and column, 1-based and separated by colons:

{ "name": "mouse-move-editor-diagnostic", "value": "src/generics/generics.ts:62:29" }

The hover stays open through narration and waits, so the narration can read the message. Any other action closes it.

  • When they update. Squiggles are recomputed when an action that changed a file finishes, not on every keystroke. While editor-type runs, existing squiggles move with the text, and new ones appear when the typing ends.
  • What checks the code. TypeScript 5.4.5, the release Monaco ships, with settings close to a Create React App tsconfig.json (strict, jsx: react-jsx, the DOM libraries). .ts and .tsx files get type errors; .js and .jsx files get syntax errors only. The MCP's codevideo_compile_lesson uses the same release and settings, so it reports what a video shows.
  • npm packages. Projects carry no node_modules, so every package a file imports gets an untyped stand-in: react, react-dom/client or any other import never goes red. Names you take from a package still work as types (ReactNode, React.FC<Props>) and with type arguments (useState<string>()). CSS and image imports resolve as they do in Create React App.
  • Known limits. A callback passed to something an untyped package returned, such as axios.get('/u').then((response) => ...), has no type for its parameters, so strict flags them as implicit any; give the parameter a type. Code written for an older TypeScript can show errors that release didn't, for example Object.keys(value) on an unconstrained generic since TypeScript 4.8.

File explorer​

Creating, opening, renaming, moving and deleting files and folders, plus the explorer's menus and inputs.

file-explorer-set-file-contents

Replaces a file's contents instantly, with nothing on screen showing it. In lessons, type with editor-type.

Value: The contents to set for the file.

file-explorer-set-file-caret-position

Sets the caret position of a file in the file explorer.

Value: The file name, row, and col to set the caret position.

file-explorer-create-file

Adds a file instantly, with nothing on screen showing it. In lessons, create files with the mouse (right-click, New File) or with touch in the terminal.

Value: The path of the file to create.

file-explorer-open-file

Opens a file from the file explorer in the editor, making it the active editor.

Value: The file's path, e.g. 'src/index.ts'. Never '1': that opens a stray editor and the typing after it is lost.

file-explorer-close-file

Close a file in the file explorer.

Value: The name of the file to close.

file-explorer-rename-file

Rename a file in the file explorer.

Value: The old and new names for the file.

file-explorer-delete-file

Delete a file in the file explorer.

Value: The name of the file to delete.

file-explorer-move-file

Move a file in the file explorer.

Value: The old and new paths for the file.

file-explorer-copy-file

Copy a file in the file explorer.

Value: The old and new paths for the file.

file-explorer-create-folder

Adds a folder instantly, with nothing on screen showing it. In lessons, create folders with the mouse (right-click, New Folder) or with mkdir in the terminal.

Value: The path of the folder to create.

file-explorer-expand-folder

Expand a folder in the file explorer.

Value: The name of the folder to expand.

file-explorer-collapse-folder

Collapse a folder in the file explorer.

Value: The name of the folder to collapse.

file-explorer-rename-folder

Rename a folder in the file explorer.

Value: The old and new names for the folder.

file-explorer-delete-folder

Delete a folder in the file explorer.

Value: The name of the folder to delete.

file-explorer-toggle-folder

Toggle a folder in the file explorer.

Value: The name of the folder to toggle.

file-explorer-move-folder

Move a folder in the file explorer.

Value: The old and new paths for the folder.

file-explorer-copy-folder

Copy a folder in the file explorer.

Value: The old and new paths for the folder.

file-explorer-show-context-menu

Show the context menu in the file explorer.

Value: The position to show the context menu.

file-explorer-hide-context-menu

Hide the context menu in the file explorer.

Value: The position to hide the context menu.

file-explorer-show-file-context-menu

Show the file context menu in the file explorer.

Value: The position to show the file context menu.

file-explorer-hide-file-context-menu

Hide the file context menu in the file explorer.

Value: The position to hide the file context menu.

file-explorer-show-folder-context-menu

Show the folder context menu in the file explorer.

Value: The position to show the folder context menu.

file-explorer-hide-folder-context-menu

Hide the folder context menu in the file explorer.

Value: The position to hide the folder context menu.

file-explorer-show-new-file-input

Show the new file input in the file explorer.

Value: The position to show the new file input.

file-explorer-show-new-folder-input

Show the new folder input in the file explorer.

Value: The position to show the new folder input.

file-explorer-hide-new-file-input

Hide the new file input in the file explorer.

Value: The position to hide the new file input.

file-explorer-hide-new-folder-input

Hide the new folder input in the file explorer.

Value: The position to hide the new folder input.

file-explorer-type-new-file-input

Type in the new file input in the file explorer.

Value: The text to type in the new file input.

file-explorer-clear-new-file-input

Clear the new file input in the file explorer.

Value: The position to clear the new file input.

file-explorer-type-new-folder-input

Type in the new folder input in the file explorer.

Value: The text to type in the new folder input.

file-explorer-clear-new-folder-input

Clear the new folder input in the file explorer.

Value: The position to clear the new folder input.

file-explorer-rename-file-draft-state

Rename a file in draft state in the file explorer.

Value: The old and new names for the file.

file-explorer-rename-folder-draft-state

Rename a folder in draft state in the file explorer.

Value: The old and new names for the folder.

file-explorer-type-rename-file-input

Type in the rename file input in the file explorer.

Value: The text to type in the rename file input.

file-explorer-type-rename-folder-input

Type in the rename folder input in the file explorer.

Value: The text to type in the rename folder input.

file-explorer-enter-new-file-input

Presses Enter in the new-file input. This creates the file and opens it in the editor, so type into it next without reopening it.

Value: The number of times to press enter in the new file input - should typically be '1'.

file-explorer-enter-new-folder-input

Presses Enter in the new-folder input, creating the folder.

Value: The number of times to press enter in the new folder input - should typically be '1'.

file-explorer-enter-rename-file-input

Enter the rename file input in the file explorer.

Value: The number of times to press enter in the rename file input - should typically be '1'.

file-explorer-enter-rename-folder-input

Enter the rename folder input in the file explorer.

Value: The number of times to press enter in the rename folder input - should typically be '1'.

Mouse​

Moving the mouse to parts of the IDE, left or right clicking, and hovering a squiggle to show its message.

mouse-move-file-explorer

Move the mouse to the middle of the file explorer.

Value: The number of times to move to the middle of the file explorer - should typically be '1'.

mouse-move-editor

Move the mouse in the editor.

Value: The number of times to move in the editor.

mouse-move-editor-tab

Move the mouse over an editor tab.

Value: The open file's path, e.g. 'src/index.ts'.

mouse-move-editor-tab-close

Move the mouse over the close button of an editor tab.

Value: The open file's path, e.g. 'src/index.ts'.

mouse-move-terminal

Move the mouse in the terminal.

Value: The number of times to move in the terminal.

mouse-move-terminal-tab

Move the mouse over a terminal tab.

Value: The name of the tab to move over.

mouse-move-terminal-tab-close

Move the mouse over the close button of a terminal tab.

Value: The name of the tab to move over.

mouse-move-file-explorer-file

Move the mouse over a file in the file explorer.

Value: The file's path, e.g. 'src/index.ts'.

mouse-move-file-explorer-folder

Move the mouse over a folder in the file explorer.

Value: The folder's path, e.g. 'src'.

mouse-move-to-coordinates-pixels

Move the mouse to specific coordinates in pixels.

Value: The coordinates in pixels to move to.

mouse-move-to-coordinates-percent

Move the mouse to specific coordinates in percent.

Value: The coordinates in percent to move to.

mouse-move-file-explorer-context-menu-new-file

Move the mouse to the new file option in the file explorer context menu.

Value: The number of times to move to the new file option - should typically be '1'.

mouse-move-file-explorer-context-menu-new-folder

Move the mouse to the new folder option in the file explorer context menu.

Value: The number of times to move to the new folder option - should typically be '1'.

mouse-move-file-explorer-file-context-menu-rename

Move the mouse to the rename option in the file context menu.

Value: The number of times to move to the rename option - should typically be '1'.

mouse-move-file-explorer-file-context-menu-delete

Move the mouse to the delete option in the file context menu.

Value: The number of times to move to the delete option - should typically be '1'.

mouse-move-file-explorer-folder-context-menu-new-file

Move the mouse to the new file option in the folder context menu.

Value: The number of times to move to the new file option - should typically be '1'.

mouse-move-file-explorer-folder-context-menu-new-folder

Move the mouse to the new folder option in the folder context menu.

Value: The number of times to move to the new folder option - should typically be '1'.

mouse-move-file-explorer-folder-context-menu-rename

Move the mouse to the rename option in the folder context menu.

Value: The number of times to move to the rename option - should typically be '1'.

mouse-move-file-explorer-folder-context-menu-delete

Move the mouse to the delete option in the folder context menu.

Value: The number of times to move to the delete option - should typically be '1'.

mouse-move-editor-context-menu-go-to-definition

Move the mouse to the go to definition option in the editor context menu.

Value: The number of times to move to the go to definition option - should typically be '1'.

mouse-move-editor-context-menu-cut

Move the mouse to the cut option in the editor context menu.

Value: The number of times to move to the cut option - should typically be '1'.

mouse-move-editor-context-menu-copy

Move the mouse to the copy option in the editor context menu.

Value: The number of times to move to the copy option - should typically be '1'.

mouse-move-editor-context-menu-paste

Move the mouse to the paste option in the editor context menu.

Value: The number of times to move to the paste option - should typically be '1'.

mouse-move-unsaved-changes-dialog-button-save

Move the mouse to the save button in the unsaved changes dialog.

Value: The number of times to move to the save button - should typically be '1'.

mouse-move-unsaved-changes-dialog-button-dont-save

Move the mouse to the don't save button in the unsaved changes dialog.

Value: The number of times to move to the don't save button - should typically be '1'.

mouse-move-unsaved-changes-dialog-button-cancel

Move the mouse to the cancel button in the unsaved changes dialog.

Value: The number of times to move to the cancel button - should typically be '1'.

mouse-move-editor-diagnostic

Moves the mouse onto a squiggle in the active editor, then shows the hover with that error's message, as VS Code does, so the narration can read it out. The hover stays up through author-speak and author-wait actions; any other action closes it. Needs squiggles on (editor-show-diagnostics or the isDiagnosticsVisible option). The location must be inside a diagnostic, e.g. one codevideo_compile_lesson reports.

Value: The active file's path, line and column, 1-based and separated by colons, e.g. 'src/generics.ts:12:38'. Leave out the column to use the first squiggle on that line.

mouse-move

Move the mouse to specific coordinates.

Value: The coordinates to move to. See the codevideo-mouse library on how this string is generated.

mouse-left-click

Left-clicks where the mouse is.

Value: The number of times to perform a left click - should typically be '1'.

mouse-double-left-click

Double-clicks where the mouse is.

Value: The number of times to perform a double left click - should typically be '1'.

mouse-triple-left-click

Triple-clicks where the mouse is.

Value: The number of times to perform a triple left click - should typically be '1'.

mouse-right-click

Right-clicks where the mouse is. Over the file explorer, a file or a folder, this opens its context menu.

Value: The number of times to perform a right click - should typically be '1'.

mouse-right-double-click

Right-clicks twice where the mouse is.

Value: The number of times to perform a double right click - should typically be '1'.

mouse-right-triple-click

Right-clicks three times where the mouse is.

Value: The number of times to perform a triple right click - should typically be '1'.

Terminal​

Typing and keystrokes in the terminal, and setting its output, prompt and working directory.

terminal-open

Opens the terminal.

Value: The number of times to open the terminal - should typically be '1'.

terminal-type

Types in the terminal; terminal-enter runs it. Supported commands: cat, cd, cp, echo, ls, mkdir, mv, pwd, touch, tree. touch <path> creates a file without opening it.

Value: The text to type in the terminal.

terminal-arrow-up

Arrow up in the terminal. Shows the previous command, if any.

Value: The number of times to press arrow up in the terminal - should typically be '1'.

terminal-arrow-down

Arrow down in the terminal.

Value: The number of times to press arrow down in the terminal.

terminal-arrow-left

Arrow left in the terminal.

Value: The number of times to press arrow left in the terminal.

terminal-arrow-right

Arrow right in the terminal.

Value: The number of times to press arrow right in the terminal.

terminal-enter

Enter key in the terminal. Submits the command.

Value: The number of times to press enter in the terminal - should typically be '1'.

terminal-tab

Tab key in the terminal.

Value: The number of times to press tab in the terminal - should typically be '1'.

terminal-shift+arrow-right

Shift + arrow right in the terminal.

Value: The number of times to press shift + arrow right in the terminal - should typically be '1'.

terminal-shift+arrow-left

Shift + arrow left in the terminal.

Value: The number of times to press shift + arrow left in the terminal - should typically be '1'.

terminal-backspace

Backspace key in the terminal.

Value: The number of times to press backspace in the terminal - should typically be '1'.

terminal-space

Space key in the terminal.

Value: The number of times to press space in the terminal - should typically be '1'.

terminal-command-left

Command + arrow left in the terminal.

Value: The number of times to press command + arrow left in the terminal - should typically be '1'.

terminal-command-right

Command + arrow right in the terminal.

Value: The number of times to press command + arrow right in the terminal - should typically be '1'.

terminal-command-c

Command + c in the terminal.

Value: The number of times to press command + c in the terminal - should typically be '1'.

terminal-command-v

Command + v in the terminal.

Value: The number of times to press command + v in the terminal - should typically be '1'.

terminal-set-output

Shows output in the terminal, e.g. for a command the terminal can't run itself (like npm install).

Value: The output to set in the terminal. Used to simulate terminal output.

terminal-set-prompt

Sets the prompt in the terminal.

Value: The prompt to set in the terminal. Can be used for custom terminal prompts.

terminal-set-present-working-directory

Sets the present working directory in the terminal.

Value: The directory to set as the present working directory in the terminal.

External​

Showing a web page, or a live preview of the code, in a browser.

external-browser

Show a browser. The value can be any valid URL. Won't work for URLs that have blocked iframe usage.

Value: The URL to open in the external browser.

external-browser-scroll

Scrolls the external browser.

Value: The number of pixels offset to scroll in the external browser.

external-web-preview

Preview the current codebase in an external web browser

Value: The number of times to open the preview - should typically be '1'.

Slide​

Showing a Markdown slide.

slide-display

Show a slide. The value can be any valid markdown representing the slide.

Value: The markdown content of the slide.

Composite​

Shortcuts that expand into several actions.

composite-create-file-with-mouse

Not supported yet: the IDE and the renderer ignore it, so nothing happens. Create the file with these steps instead: mouse-move-file-explorer, mouse-right-click, mouse-move-file-explorer-context-menu-new-file, mouse-left-click, file-explorer-type-new-file-input, file-explorer-enter-new-file-input.

Value: The name of the file to create.

composite-create-file-with-terminal

Not supported yet: the IDE and the renderer ignore it, so nothing happens. Type touch <path> with terminal-type, then terminal-enter, instead.

Value: The name of the file to create.

composite-create-folder-with-mouse

Not supported yet: the IDE and the renderer ignore it, so nothing happens. Create the folder with these steps instead: mouse-move-file-explorer, mouse-right-click, mouse-move-file-explorer-context-menu-new-folder, mouse-left-click, file-explorer-type-new-folder-input, file-explorer-enter-new-folder-input.

Value: The name of the folder to create.

composite-create-folder-with-terminal

Not supported yet: the IDE and the renderer ignore it, so nothing happens. Type mkdir <path> with terminal-type, then terminal-enter, instead.

Value: The name of the folder to create.

composite-close-all-editors-with-mouse

Not supported yet: the IDE and the renderer ignore it, so nothing happens. Close editors one at a time instead, with mouse-move-editor-tab-close and mouse-left-click.

Value: The number of times to execute this action - should typically be '1'.

composite-close-all-editors-with-keyboard

Not supported yet: the IDE and the renderer ignore it, so nothing happens. Close editors one at a time instead, with mouse-move-editor-tab-close and mouse-left-click.

Value: The number of times to execute this action - should typically be '1'.