Operations Overview
Operations are the only way to mutate project data in Razorbill. Every operation validates its inputs, applies changes atomically, and produces a structured diff with undo support.
How Operations Work
Operations are submitted as JSON, either individually or as a transaction (array of operations):
[
{ "op": "CreateEntity", "params": { "name": "Player" } },
{ "op": "AddComponent", "params": { "entity_name": "Player", "component_type": "Transform" } }
]
If any operation in a transaction fails, the entire transaction is rolled back.
Applying Operations
Via CLI
./build/toolchain/cli/eng_cli apply-plan ~/MyProject plan.json --json
Via AI Agent
./build/toolchain/cli/eng_cli agent ~/MyProject Main \
--prompt "Create a red cube at position 0,3,0"
Via Editor
Operations are applied through the editor UI and AI chat panel.
Categories
Entity
Create, delete, clone, and reparent entities. Full reference →
| Operation | Description |
|---|---|
| CreateEntity | Create a new entity with optional parent |
| DeleteEntity | Remove an entity from the scene |
| CloneEntity | Duplicate an entity with all components |
| ReparentEntity | Move an entity to a different parent |
Component
Add, remove, and modify components on entities. Full reference →
| Operation | Description |
|---|---|
| AddComponent | Attach a component to an entity |
| RemoveComponent | Remove a component from an entity |
| SetProperty | Modify a property value on a component |
Asset
Create primitives, materials, and import external assets. Full reference →
| Operation | Description |
|---|---|
| CreatePrimitive | Generate a cube, sphere, plane, or cylinder mesh |
| CreatePBRMaterial | Apply a PBR material to an entity |
| ImportMesh | Import a glTF/glb mesh file |
| ImportTexture | Import an image as a texture asset |
Lighting
Create lights and apply lighting presets. Full reference →
| Operation | Description |
|---|---|
| CreateDirectionalLight | Create a sun/moon directional light |
| CreatePointLight | Create an omnidirectional point light |
| ApplyLightingPreset | Apply a predefined lighting setup |
Script
Create, write, attach, and compile scripts. Full reference →
| Operation | Description |
|---|---|
| CreateScript | Create a new C++ script file |
| WriteScriptContent | Write code to a script file |
| AttachScript | Attach a script to an entity |
| DetachScript | Remove a script from an entity |
| CompileScripts | Compile scripts to dynamic libraries |
UI
Create UI canvases and elements. Full reference →
| Operation | Description |
|---|---|
| CreateUICanvas | Create a UI canvas (root of UI hierarchy) |
| AddUIElement | Add a UI widget element to a canvas |
Prefab
Create and instantiate reusable prefabs. Full reference →
| Operation | Description |
|---|---|
| CreatePrefab | Save an entity as a reusable prefab |
| InstantiatePrefab | Create entities from a prefab |
World
Generate terrain and multi-chunk worlds. Full reference →
| Operation | Description |
|---|---|
| CreateTerrain | Generate procedural terrain |
| CreateWorld | Generate a tiled world with multiple chunks |
Entity Targeting
Many operations accept either entity_guid or entity_name:
- Use
entity_guidwhen referencing existing entities with known GUIDs - Use
entity_namewhen referencing entities created in the same transaction
[
{ "op": "CreateEntity", "params": { "name": "Bullet" } },
{ "op": "AddComponent", "params": {
"entity_name": "Bullet",
"component_type": "Rigidbody"
}}
]