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.
Editor
Typing, keystrokes, selection, scrolling, the context menu and TypeScript squiggles in the editor.
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.
Saves the active editor. Compile checks and file reads only see saved text, so save after typing.
Value: Always '1'.
Move the editor caret up one row.
Value: The number of rows to move up.
Move the editor caret down one row.
Value: The number of rows to move down.
Move the editor caret left one column.
Value: The number of columns to move left.
Move the editor caret right one column.
Value: The number of columns to move right.
Press the Enter key in the editor.
Value: The number of times to press Enter.
Press the Tab key in the editor.
Value: The number of times to press Tab.
Hold Shift and move the editor caret left.
Value: The number of columns to move left.
Hold Shift and move the editor caret right.
Value: The number of columns to move right.
Hold Shift and move the editor caret down.
Value: The number of rows to move down.
Hold Shift and move the editor caret up.
Value: The number of rows to move up.
Press Cmd+D in the editor.
Value: The number of times to press Cmd+D.
Press the Backspace key in the editor.
Value: The number of times to press Backspace.
Press the Space key in the editor.
Value: The number of times to press Space.
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.
Delete the current line in the editor.
Value: The line to delete.
Extend selection to the end of the logical line, excluding the newline.
Value: Number of key presses.
Extend selection to the absolute start of the logical line, excluding the newline.
Value: Number of key presses.
Extend selection to the end of the logical line, excluding the newline.
Value: Number of key presses.
Extend selection to the absolute start of the logical line, excluding the newline.
Value: Number of key presses.
Hold Command and move the editor caret left.
Value: The number of columns to move left.
Hold Command and move the editor caret right.
Value: The number of columns to move right.
Hold Command and press D in the editor.
Value: The number of times to press Cmd+D.
Hold Command and press C in the editor.
Value: The number of times to press Cmd+C.
Hold Command and press V in the editor.
Value: The number of times to press Cmd+V.
Hold Shift and move the editor caret down.
Value: The number of rows to move down.
Hold Shift and move the editor caret up.
Value: The number of rows to move up.
Scroll the editor up.
Value: The number of pixels to scroll up.
Scroll the editor down.
Value: The number of pixels to scroll down.
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'.
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-typeruns, 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)..tsand.tsxfiles get type errors;.jsand.jsxfiles get syntax errors only. The MCP'scodevideo_compile_lessonuses 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/clientor 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, sostrictflags them as implicitany; give the parameter a type. Code written for an older TypeScript can show errors that release didn't, for exampleObject.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.
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.
Sets the caret position of a file in the file explorer.
Value: The file name, row, and col to set the caret position.
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.
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.
Close a file in the file explorer.
Value: The name of the file to close.
Rename a file in the file explorer.
Value: The old and new names for the file.
Delete a file in the file explorer.
Value: The name of the file to delete.
Move a file in the file explorer.
Value: The old and new paths for the file.
Copy a file in the file explorer.
Value: The old and new paths for the file.
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.
Expand a folder in the file explorer.
Value: The name of the folder to expand.
Collapse a folder in the file explorer.
Value: The name of the folder to collapse.
Rename a folder in the file explorer.
Value: The old and new names for the folder.
Delete a folder in the file explorer.
Value: The name of the folder to delete.
Toggle a folder in the file explorer.
Value: The name of the folder to toggle.
Move a folder in the file explorer.
Value: The old and new paths for the folder.
Copy a folder in the file explorer.
Value: The old and new paths for the folder.
Show the new file input in the file explorer.
Value: The position to show the new file input.
Show the new folder input in the file explorer.
Value: The position to show the new folder input.
Hide the new file input in the file explorer.
Value: The position to hide the new file input.
Hide the new folder input in the file explorer.
Value: The position to hide the new folder input.
Type in the new file input in the file explorer.
Value: The text to type in the new file input.
Clear the new file input in the file explorer.
Value: The position to clear the new file input.
Type in the new folder input in the file explorer.
Value: The text to type in the new folder input.
Clear the new folder input in the file explorer.
Value: The position to clear the new folder input.
Rename a file in draft state in the file explorer.
Value: The old and new names for the file.
Rename a folder in draft state in the file explorer.
Value: The old and new names for the folder.
Type in the rename file input in the file explorer.
Value: The text to type in the rename file input.
Type in the rename folder input in the file explorer.
Value: The text to type in the rename folder 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'.
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'.
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'.
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.
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'.
Move the mouse in the editor.
Value: The number of times to move in the editor.
Move the mouse over an editor tab.
Value: The open file's path, e.g. 'src/index.ts'.
Move the mouse over the close button of an editor tab.
Value: The open file's path, e.g. 'src/index.ts'.
Move the mouse in the terminal.
Value: The number of times to move in the terminal.
Move the mouse over a terminal tab.
Value: The name of the tab to move over.
Move the mouse over the close button of a terminal tab.
Value: The name of the tab to move over.
Move the mouse over a file in the file explorer.
Value: The file's path, e.g. 'src/index.ts'.
Move the mouse over a folder in the file explorer.
Value: The folder's path, e.g. 'src'.
Move the mouse to specific coordinates in pixels.
Value: The coordinates in pixels to move to.
Move the mouse to specific coordinates in percent.
Value: The coordinates in percent to move to.
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.
Move the mouse to specific coordinates.
Value: The coordinates to move to. See the codevideo-mouse library on how this string is generated.
Left-clicks where the mouse is.
Value: The number of times to perform a left click - should typically be '1'.
Double-clicks where the mouse is.
Value: The number of times to perform a double left click - should typically be '1'.
Triple-clicks where the mouse is.
Value: The number of times to perform a triple left click - should typically be '1'.
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'.
Right-clicks twice where the mouse is.
Value: The number of times to perform a double right click - should typically be '1'.
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.
Opens the terminal.
Value: The number of times to open the terminal - should typically be '1'.
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.
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'.
Arrow down in the terminal.
Value: The number of times to press arrow down in the terminal.
Arrow left in the terminal.
Value: The number of times to press arrow left in the terminal.
Arrow right in the terminal.
Value: The number of times to press arrow right in the terminal.
Enter key in the terminal. Submits the command.
Value: The number of times to press enter in the terminal - should typically be '1'.
Tab key in the terminal.
Value: The number of times to press tab in the terminal - should typically be '1'.
Shift + arrow right in the terminal.
Value: The number of times to press shift + arrow right in the terminal - should typically be '1'.
Shift + arrow left in the terminal.
Value: The number of times to press shift + arrow left in the terminal - should typically be '1'.
Backspace key in the terminal.
Value: The number of times to press backspace in the terminal - should typically be '1'.
Space key in the terminal.
Value: The number of times to press space in the terminal - should typically be '1'.
Command + arrow left in the terminal.
Value: The number of times to press command + arrow left in the terminal - should typically be '1'.
Command + arrow right in the terminal.
Value: The number of times to press command + arrow right in the terminal - should typically be '1'.
Command + c in the terminal.
Value: The number of times to press command + c in the terminal - should typically be '1'.
Command + v in the terminal.
Value: The number of times to press command + v in the terminal - should typically be '1'.
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.
Sets the prompt in the terminal.
Value: The prompt to set in the terminal. Can be used for custom terminal prompts.
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.
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.
Scrolls the external browser.
Value: The number of pixels offset to scroll in the external browser.
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.
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.
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.
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.
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.
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.
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'.
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'.