Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Godot Cli?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tipoli5890-godot-cli)
---
name: godot-cli
description: >-
Run Godot from a terminal: find the binary, --headless, -s SceneTree scripts, --import,
--quit-after, arguments after --, logs, exit codes.
---
# godot-cli — Godot from a terminal, headless and bounded
Everything an agent does to a Godot project without opening the editor goes through these flags.
Most runs exit 0 whatever happens, and some never end, so every run here is bounded and judged
by what it prints.
## Load what the situation needs
| The situation | Read |
|---|---|
| Which flag does what; what a command writes into the project; exit codes; logs and user data | `reference/flags.md` |
| Writing a `-s` script: its arguments, files, a scene run for N frames, a sentinel | `reference/headless-scripts.md` |
| Looking up a class, method, property or signal offline; reading its description | `reference/api-lookup.md` |
| "Does the change work?": import, load every file, run scenes | `godot-verify` |
| Unit tests and their runner | `godot-testing` |
| Frames, screenshots, scripted input, journeys | `godot-play-harness` |
| Export commands and templates | `godot-export` |
| Creating a project, its settings | `godot-new-project` |
| A Godot 3 name, or checking many API names at once | `godot-version-guard` |
## Find the binary
```bash
export GODOT_BIN=/Applications/Godot.app/Contents/MacOS/Godot # macOS: the executable inside the app
python3 scripts/godot_run.py which
```
```
binary: /Applications/Godot.app/Contents/MacOS/Godot
from: GODOT_BIN
version: <major>.<minor>.<patch>.stable.official.<commit>
build: editor
godot_run: PASS <major>.<minor>.<patch>.stable.official.<commit>
```
`GODOT_BIN` is the one place the binary is named; every script in this plugin reads it, and
none guesses a path. `--godot PATH` overrides it and takes a path, a macOS app bundle, or a name on
PATH. `build: editor` matters: `--import`, `--doctool` and exports exist only in editor builds.
## Run once, bounded
```bash
python3 scripts/godot_run.py run --project . --sentinel ROUTES_BAKED -- -s res://tools/bake_routes.gd -- route=ledge
python3 scripts/godot_run.py run --project . --expect 3 -- -s res://tools/check_depot.gd
python3 scripts/godot_run.py run --project . --timeout 600 -- --import
```
Everything after the first `--` goes to Godot unchanged; a second `--` starts the script's own
arguments. A run whose script hit a null in `_initialize`, so it never reached `quit()`:
```
MARKER SCRIPT ERROR: Cannot call method 'get_child_count' on a null value. (at: _initialize (res://tools/bake_routes.gd:5))
godot_run: FAIL exit=0 wall=4.3s markers=1 sentinel=missing (added --quit-after 600)
```
Godot exits 0 there; the backstop ends the hang. The verdict line comes last and the exit code
says the same:
| Exit | Verdict | Meaning |
|---|---|---|
| 0 | `PASS` | ended by itself inside the timeout, with the expected exit code, no marker line, and the sentinel when one was asked for |
| 2 | `FAIL` | a marker line (each on a `MARKER` line above), or another exit code than `--expect` |
| 3 | `UNVERIFIED` | a timeout with no marker, a sentinel that never came, no binary |
| 1 | `refused` / usage | `-e` or `-p` (the editor), a folder with no `project.godot`, a bad flag |
| Flag | Effect |
|---|---|
| `--godot PATH` | the binary; default `$GODOT_BIN` |
| `--project DIR` | passed as `--path DIR`; without it there is no project and `res://` is an empty folder |
| `--timeout S` | wall clock (default 120); the only end for a loop that never yields a frame |
| `--backstop N` | the `--quit-after N` added to a run of game code that has none (default 600; 0 adds none). Not added to `--import`, `--doctool`, exports, conversion or `--check-only`, which end by themselves |
| `--sentinel TEXT` | a stdout line that must start with TEXT; without it a run that never got there can still look clean |
| `--expect N` | the exit code a pass needs (default 0), for a script that ends with `quit(N)` |
| `--allow-warnings` | `WARNING:` lines become `NOTE` lines |
| `--no-headless` | leaves `--headless` out: a window opens, so a desktop session only |
| `--no-echo` | prints only the markers and the verdict, not the command and the two streams |
It adds `--headless -l en` itself, runs from an empty temp directory so no stray `project.godot`
is picked up, and reports Godot's exit code as data.
## The same run by hand
```bash
"$GODOT_BIN" --headless -l en --path . --quit-after 600 -s res://tools/bake_routes.gd -- route=ledge
```
Then, every time:
1. **`--headless -l en --path DIR`.** Headless needs no display; `-l en` keeps the editor's own
messages in English.
2. **A wall clock and a backstop.** `--quit-after N` ends a script that errored before `quit()`
(with exit 0); only a wall clock ends a busy loop or the no-main-scene hang. macOS has no
`timeout` command (`godot-verify` → `reference/timeouts.md`).
3. **Judge by the output.** A sentinel line the script prints after its work, and no
`SCRIPT ERROR:`, `SHADER ERROR:`, `ERROR:` or `WARNING:` line on either stream
(`godot-verify` → `reference/markers.md`).
4. **No `--quiet` on a judged run.** It silences stdout, sentinel included.
5. **`--import` once before relying on `class_name`.** The class cache it writes is what makes
global class names resolve.
6. **Editor commands write into the project.** `--import` adds `.godot/`, `.uid` and `.import`
files; run them on a copy of a project that is not yours to change.
## Common commands
| Goal | Arguments after `"$GODOT_BIN" --headless -l en --path .` |
|---|---|
| Import once | `--import` |
| Run a tool script with options | `--quit-after 600 -s res://tools/bake_routes.gd -- route=ledge` |
| Run one scene for 120 frames, frame-exact | `--fixed-fps 60 --quit-after 120 --scene res://depot.tscn` |
| Run the main scene briefly | `--quit-after 120` |
| Keep the log | `--log-file /abs/path/run.log` (a relative path lands in the project) |
`--version` and `--help` need no project. The class reference dumps (`--doctool DIR`,
`--dump-extension-api-with-docs`) run from an empty folder, never inside a project
(`reference/api-lookup.md`).
## Discipline
- **Never believe an exit code of 0.** It follows parse errors, runtime errors, missing resources,
broken shaders and backstop-ended hangs alike; only `quit(N)`, a failed export, a `--path` that
does not exist and a crash change it.
- **Bound every run twice:** `--quit-after` inside, a wall clock outside.
- **Print the sentinel last, from the work itself,** never from `_finalize()`, which runs on
every way out (`reference/headless-scripts.md`).
- **Name the binary once,** in `GODOT_BIN`; a script that finds Godot by guessing will find the
wrong one on the next machine.
- **Look names up in the binary in use,** not from memory (`reference/api-lookup.md`).
- **Headless proves no pixels.** Rendering, GPU shader compilation and audio output need a window;
a headless run cannot check them.
## Scope — what this skill does NOT do
| Not here | Go to |
|---|---|
| The verdict on a change: import, load, run scenes | `godot-verify` |
| Unit tests | `godot-testing` |
| Windowed runs, frames, input, journeys | `godot-play-harness` |
| Exports, presets and templates | `godot-export` |
| A new project and its settings | `godot-new-project` |
| Godot 3 flags and names, `--convert-3to4` | `godot-version-guard` |