For Godot 4 MIT licensed

Faster, safer Godot scene edits for agents

godot-cli gives a coding agent one command for a whole scene change, from a terminal or over MCP. Every edit is checked against Godot's own class reference, and the .tscn, .tres and project.godot files it writes match the editor's saves byte for byte.

$ curl -fsSL https://raw.githubusercontent.com/unabated-games/godot-cli/main/install.sh | bash
Linux, macOS and Windows, x86_64 and aarch64. One binary with no runtime dependencies.
Gem Grove
Gem Grove running: a robot in a forest clearing with gems and three purple slimes, three hearts top left and a score of 2 top right
$ godot-cli scene instance add main.tscn \
    --parent /root/Main --name HUD --catalog-id ui/hud
[node name="HUD" parent="." unique_id=1886270267
  instance=ExtResource("4_7dm0k")]
A frame from Gem Grove, the demo further down. Every scene in it was written by godot-cli.

Ask an agent for a HUD and look at the scene tree

Scene text is hard to write blind, so an agent left alone builds the HUD in GDScript. The game runs and the scene stays empty. godot-cli gives it a safe way to put the nodes where the editor expects them.

Without godot-cli
func _ready() -> void:
    var bar = load("res://ui/health_bar/health_bar.tscn").instantiate()
    add_child(bar)
Scene dock: hud.tscn
  • HUD
  • Nothing else here. The layout exists only while the game is playing.
With godot-cli
$ godot-cli scene instance add hud.tscn \
    --parent /root/HUD --name PlayerHealth \
    --catalog-id ui/health_bar --project-root .
Scene dock: hud.tscn
  • HUD
  • PlayerHealth instance of ui/health_bar
  • Score
  • PauseButton
Key art for Gem Grove: the robot runs through a forest clearing reaching for a gem while three purple slimes chase it

This game was built from a terminal

Gem Grove is one shell script of godot-cli commands plus six short GDScript files. Nobody opened the editor and nobody typed a line of scene text. Play it here, then read how each stage went in.

Gem Grove in play
WASD or the arrow keys. On a phone, drag anywhere. Loads on click. About 10 MB the first time.
  • 8scenes, every one passing scene validate
  • 13signal connections, all in the scene files
  • 319lines of GDScript, for the rules and the animation
  • 0lines of hand-written scene text

Four stages, and the frame godot-cli captured after each

  1. Stage 1: the empty forest clearing
    Stage 1 A project and a level A new project.godot, WASD and arrow keys in the input map, and a level scene with its background.
    project new --name "Gem Grove"
    project input apply
  2. Stage 2: gems, slimes and the robot placed in the clearing
    Stage 2 Actors from the catalog The robot, a gem and a slime are each their own scene. One patch places six gems and three slimes by catalog id.
    catalog add actors/gem.tscn
    scene apply main.tscn --patch
  3. Stage 3: hearts, a score counter and a title card over the clearing
    Stage 3 A HUD you can open in the editor Hearts, score, a touch joystick, title card and game over card: 23 nodes, fonts and style boxes in a single write.
    scene apply ui/hud.tscn --patch
    scene instance add --catalog-id
  4. Stage 4: the game in play with a score of 2 and a burst where a gem was picked up
    Stage 4 Rules, then a test drive The run clicks Play and steers the robot into two gems. The score reads 2, and the log has no errors.
    project run --click PlayButton@10
      --press move_right@20..55
Read the build, stage by stage

Why you can trust what it writes

Writing a scene Godot can open is a low bar. The bar here is writing the scene Godot itself would have saved, then proving the change works before anyone reviews it.

It writes what the editor writes

On every push, Godot saves a fixture scene headless, godot-cli writes the same scene, and cmp compares the two files. The test runs against the current stable Godot releases and the newest prerelease. When it fails, the tool is wrong and the editor is right.

No reformatted-by-tool noise in your diffs, and opening the project in the editor changes nothing.

Stay byte-compatible with Godot

It catches the typo before the run

scene validate checks every value, signal and method against a table generated from Godot's own class reference. It reads your scripts too, so a connection to a method that does not exist fails here, not in the running game.

[err] property_type_mismatch:
Control.visible is bool, and this
value is vector2

One document, one write

A player is a node, a collision shape, a sprite and a texture reference. Send the whole change as one JSON document. If any step fails, the file on disk is untouched, and --dry-run shows the tree you would end up with.

{ "recipe": "player_2d",
  "parent": "/root/Main",
  "name": "Player",
  "texture": "res://art/player.png" }
The frame a project run returned
"ok": true,
"error_count": 0

Then it runs the game and looks

project run imports the project, runs it, keeps the last frame and reads the log. It exits 1 on any ERROR line. It can click a button on a chosen frame or hold an input action, so an agent proves the wiring without test code in your game. Over MCP the frame comes back as an image.

Verify a change by running the game

It knows what you have already built

An agent starts each session knowing none of your parts, so it rebuilds your health bar out of raw nodes. A catalog manifest beside a scene says what it is for, and the agent instances it by id.

actors/gem
A gem that emits collected when the player touches it
When to use Anything the player picks up for score
Signals collected
Teach an agent your sub-scenes

Built for agents, usable by hand

godot-cli mcp serves every command as a tool for Claude Code, Cursor and OpenCode. In a shell, --json on any command returns one envelope with a stable exit code. For people there is help on everything, a man page, and completions for bash, zsh and fish.

$ godot-cli scene validate main.tscn --project-root . --json
{ "ok": true, "data": { … }, "messages": [], "failure": null }
Set up an agent

What it is not

  • It is not a game engine. Running the game is handed to the Godot you already have installed.
  • It does not read binary .scn or .res files.
  • It will not replace the editor when you are nudging a sprite two pixels to the left by eye.
  • Godot prereleases are tested on every push, as a check that does not block. A format change there shows up in our CI before it shows up in your project.

Install it and author a first scene

Two lines, then the getting started page walks you through a first scene.

$ curl -fsSL https://raw.githubusercontent.com/unabated-games/godot-cli/main/install.sh | bash
$ source "$HOME/.godot-cli/env.sh"