WebSocket bridge for headless / scripted control of Godot scenes.
Project description
godot-cli-control
WebSocket bridge for headless / scripted control of Godot 4 scenes — Python client + CLI.
Install
pipx install godot-cli-control
# or, for unreleased main:
pipx install "git+https://github.com/ClaymanTwinkle/godot-cli-control.git#subdirectory=python"
The wheel ships the Godot plugin source so the init command can drop it into your project.
Requires Python ≥ 3.10.
One-shot setup of a Godot project
cd path/to/your_godot_project
godot-cli-control init # copies plugin, patches project.godot, detects Godot binary
godot-cli-control daemon start
godot-cli-control tree 3
godot-cli-control daemon stop
init is idempotent — running it twice on the same project does nothing the second time. Pass --force to overwrite an existing addons/godot_cli_control/.
init also writes .claude/skills/godot-cli-control/SKILL.md and .codex/skills/godot-cli-control/SKILL.md so AI agents working in your Godot project can pick up this CLI surface automatically. Use --no-skills to skip, or --skills-only to refresh just those files after a CLI upgrade. See the top-level README for details.
Async API
import asyncio
from godot_cli_control import GameClient
async def main():
async with GameClient(port=9877) as client:
tree = await client.get_scene_tree(depth=3)
await client.click("/root/MyScene/Button")
await client.action_press("jump")
await client.wait_game_time(0.5)
await client.action_release("jump")
png_bytes = await client.screenshot()
open("frame.png", "wb").write(png_bytes)
asyncio.run(main())
Sync API (for scripts and tests)
# script.py
def run(bridge):
bridge.click("/root/MyScene/StartButton")
bridge.wait(2)
bridge.tap("attack")
godot-cli-control run script.py --headless # auto-starts and stops the daemon
pytest fixtures
pip install "godot-cli-control[pytest]"
The package ships a pytest plugin (auto-loaded via pytest11 entry-point):
# tests/test_jump.py — no fixture boilerplate needed
def test_jump(godot_daemon, bridge):
bridge.click("/root/Game/Start")
bridge.tap("jump")
assert bridge.get_property("/root/Player", "on_floor") is False
godot_daemon(session-scoped) starts headless Godot once and stops it after all tests; if a daemon is already running it's reused (and not stopped at teardown — keeps your IDE workflow alive).bridge(function-scoped) gives a freshGameBridge; on teardown it callsrelease_all()so aholdleft behind by one case can't bleed into the next, then closes the connection.
CLI options:
--godot-cli-port=N # GameBridge port (default 9877)
--godot-cli-no-headless # open a real Godot window
--godot-cli-project-root=DIR # default: pytest rootdir
CLI
godot-cli-control init [--path DIR] [--force]
godot-cli-control daemon start [--headless --record --movie-path X --fps N --port N]
godot-cli-control daemon stop
godot-cli-control run <script.py> [--headless ...]
godot-cli-control tree [depth]
godot-cli-control click <node_path>
godot-cli-control screenshot [output.png]
godot-cli-control press|release|tap|hold|combo|release-all <args...>
The port is read from .cli_control/port if you don't pass --port, so RPC calls just work after daemon start.
Documentation
See the Godot plugin README for the full RPC reference, activation modes, security model, and known limitations.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file godot_cli_control-0.1.9.tar.gz.
File metadata
- Download URL: godot_cli_control-0.1.9.tar.gz
- Upload date:
- Size: 64.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21c71398a26e27e970646033e66f9b0f222f4e46b5d4e282884ac5f21bd373b1
|
|
| MD5 |
7723dbd74be57b1f48775a98bfea3f67
|
|
| BLAKE2b-256 |
1cb620babd72b42d56a76fc951a2053b9a49a1638d35ff3eefe3a2247948dd35
|
Provenance
The following attestation bundles were made for godot_cli_control-0.1.9.tar.gz:
Publisher:
release.yml on ClaymanTwinkle/godot-cli-control
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
godot_cli_control-0.1.9.tar.gz -
Subject digest:
21c71398a26e27e970646033e66f9b0f222f4e46b5d4e282884ac5f21bd373b1 - Sigstore transparency entry: 1399271326
- Sigstore integration time:
-
Permalink:
ClaymanTwinkle/godot-cli-control@986826176a06d09d0ac0ae712a7f63d4dde6cb25 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/ClaymanTwinkle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@986826176a06d09d0ac0ae712a7f63d4dde6cb25 -
Trigger Event:
push
-
Statement type:
File details
Details for the file godot_cli_control-0.1.9-py3-none-any.whl.
File metadata
- Download URL: godot_cli_control-0.1.9-py3-none-any.whl
- Upload date:
- Size: 67.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f3b00c16e0a7806e314ef8b10edb463535434a2e14ae9391bd900dacc61a10d
|
|
| MD5 |
86cb2d66871ccac7cfd4671aab30979b
|
|
| BLAKE2b-256 |
2dcd87081cfa531995e80f5034033ebc4be5eddb0fa600c6437e6e19eed9247a
|
Provenance
The following attestation bundles were made for godot_cli_control-0.1.9-py3-none-any.whl:
Publisher:
release.yml on ClaymanTwinkle/godot-cli-control
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
godot_cli_control-0.1.9-py3-none-any.whl -
Subject digest:
0f3b00c16e0a7806e314ef8b10edb463535434a2e14ae9391bd900dacc61a10d - Sigstore transparency entry: 1399271333
- Sigstore integration time:
-
Permalink:
ClaymanTwinkle/godot-cli-control@986826176a06d09d0ac0ae712a7f63d4dde6cb25 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/ClaymanTwinkle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@986826176a06d09d0ac0ae712a7f63d4dde6cb25 -
Trigger Event:
push
-
Statement type: