Rive AI Agent
The Rive Editor includes a built-in AI Coding Agent that understands the Rive Luau API, can create and modify scripts, build animations, manage ViewModels, and more. No API keys, external apps, or setup required.
What the AI Agent Knows
The agent is initialized with:
- Complete Rive Luau type definitions — all types (
Node<T>,Layout<T>,Converter<T>,PathEffect<T>,ListenerAction<T>,TransitionCondition<T>,Paint,Path,Vector,Mat2D,Color,Renderer, etc.) - Scripting conventions — factory functions, lifecycle callbacks, the
selfpattern - Editor context — access to all artboards, objects, scripts, animations, and ViewModels in your file
Available Tools
The AI agent has access to 14 specialized tools for interacting with different parts of the Rive editor.
Scripting Tools
| Tool | What It Does |
|---|---|
text_editor | View, create, and edit script files. Supports viewing file contents, creating new files, replacing text, and appending. |
script_diagnostics | Get linter errors and warnings for a specific script or all scripts in the workspace. |
get_scripts | List all scripts with their return types (node, layout, converter, pathEffect, listenerAction, transitionCondition, tests, none). |
run_tests | Execute a Test script and see pass/fail results. |
recompile_all_scripts | Commit all script changes to the Luau VM so the runtime picks them up. |
grep | Search for patterns across all scripts. Supports case-sensitive, whole-word, and regex matching. |
read_console | Read print output and errors from script execution. Filter by script name, entry type, or text content. |
Editor Tools
| Tool | What It Does |
|---|---|
animation_editor | Create and modify state machines and linear animations. Create layers, states, transitions, conditions, and keyframes. |
layout_editor | Create flexbox-style layouts with alignment, padding, gaps, and text nodes. |
viewmodel_editor | Create ViewModels with typed properties, create instances, set up data bindings between objects and ViewModel properties. |
component_editor | Add component (artboard) instances to artboards. Supports node, leaf, and layout modes. |
open_file_editor | Manage artboards — list, create, rename, resize, and set as active. |
query_core_object_tool | Query and modify properties of any Rive object by ID. List children, get/set property values. |
path_editor | Create shapes with paths, fills, and strokes. Build vector graphics programmatically. |
Tool Command Schemas (What to Include in Prompts)
When asking the AI to use a tool, include the command shape explicitly (command + required fields). This reduces retries and malformed calls.
text_editor
- Required:
command,path - Command-specific fields:
view: optionalview_rangecreate:text(andcreate_new: truefor new files)str_replace:old_string,new_stringinsert:text
animation_editor
- Required:
command - Common command schemas:
createStateMachine:name, optionallinearAnimations,layerscreateLinearAnimations:linearAnimationsupdateStates:stateswithid, optionalanimationId,x,ycreateTransitions:stateswithid,transitionscreateConditions:transitionswithid,conditionsmodifyKeyFrames:animationId, optionaladd/change/delete
layout_editor
- Required:
command - Typical creation fields: parent/layout target, sizing, direction, alignment, padding, gap, and children/text payload.
viewmodel_editor
- Required:
command - Typical fields: view model name, property definitions (type + name), instance creation, and binding payloads.
- Important behavior:
bindViewModelToComponentcan create missing target property/instance names when not found.
component_editor
- Required:
command - Use
addComponentsfor regular component instances. - Use
addComponentListonly with a ViewModel list property; the list auto-generates children at runtime. - Do not manually add children under a component list container.
read_console
- Optional filters:
script_name,entry_type,text_search - Pagination:
limit,offset, optionalreverse
grep
- Required:
pattern - Optional:
case_sensitive,match_whole_word,regular_expression,inclusion_set
Important Operational Constraints
- The script console is not live introspection:
read_consolecan only read entries that were already produced by a prior run. - Script paths are flat in Rive: no folders/slashes and no
.lua/.luauextensions. - Prefer ViewModels for data binding workflows; state machine inputs are a legacy/deprecated path unless explicitly required.
- When binding strings to text, bind to the Text Run, not the parent Text object.
get_scriptsreturn typenonemeans a utility/module script (shared logic, not attachable behavior).- Scripts run in pure Luau + Rive APIs, not Roblox runtime globals (
game,workspace,Instance). - Keep integer-style runtime values 32-bit safe unless you explicitly target wider numeric behavior.
Use: Goal + target object names + exact tool command fields.
Example: “Use script_diagnostics on PlayerController, then text_editor.str_replace to fix type errors, then recompile_all_scripts.”
What This Teaches You (Even Without AI)
The tool workflow maps directly to a strong manual scripting loop in the editor:
- Write or edit a typed script (factory + protocol callbacks).
- Run diagnostics and fix all warnings/errors.
- Recompile so runtime bytecode updates.
- Trigger behavior in the scene (Play, pointer interaction, state changes).
- Inspect console output and iterate.
- For shared logic, add/update tests and run them before recompiling.
This loop is valuable even if you never use the AI assistant, because it mirrors how Rive actually validates and executes scripts.
Tips for Working with the AI
Be Specific
The more context you provide, the better the results.
# Less effective
"Make a button"
# More effective
"Create a Node script that draws a rounded rectangle button
at position (100, 50) with size 200x60. The button should
change color on pointerDown and have an Input<string> for
the label text."
Reference Existing Elements
If your file already has ViewModels, artboards, or scripts, mention them by name.
"Update the 'GameController' script to read the 'score'
property from the 'PlayerData' ViewModel and display it
using the draw() function."
Iterate
The AI can see its own output. Build incrementally:
- "Create a basic Node script that draws a circle"
- "Add an advance() function that makes it pulse"
- "Add a pointerDown handler that changes the color"
- "Run the tests to make sure everything compiles"
Common Workflows
Creating a New Script
- Describe what you want the script to do
- The AI uses
text_editorto create the file - It runs
script_diagnosticsto check for errors - It calls
recompile_all_scriptsto commit to the VM
Setting Up Data Binding
- "Create a ViewModel called 'PlayerData' with properties: score (number), name (string), isActive (boolean)"
- "Bind the 'score' property to the text run in my artboard"
- "Create a Node script that updates the score on pointerDown"
Building Animations
- "Create a state machine called 'ButtonSM' with Idle and Pressed states"
- "Add transitions between the states"
- "Create linear animations for each state"
- "Add keyframes for the opacity property"
Debugging
- "Read the console output for the 'GameController' script"
- "Run diagnostics on all scripts"
- "Search for all uses of 'playerHealth' across scripts"
Limitations
The AI agent cannot:
- Preview or render animations visually
- Access external files, APIs, or the internet
- Undo its own actions (but you can use editor undo)
- Interact with runtime runtimes (web, iOS, Android)
- Access Rive community files or external .riv files
The AI agent works within your current file only. It sees the artboards, scripts, ViewModels, and objects in the file you have open.
Quick Reference
| Task | What to Ask |
|---|---|
| Write a script | "Create a [Node/Layout/Converter/PathEffect] script that..." |
| Fix errors | "Run diagnostics and fix any issues" |
| Find code | "Search for 'functionName' across all scripts" |
| Check output | "Read the console output" |
| Create animation | "Create a state machine with..." |
| Set up data | "Create a ViewModel with..." |
| Build layout | "Create a flex layout with..." |
| Add component | "Add the 'Button' artboard as a component" |
See Also: Script Types Overview, Welcome
Next Steps
- Continue to Inputs and Data Binding
- Need a refresher? Review Quick Reference