Skip to main content

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.

Install

pip install godot-cli-control

Requires Python ≥ 3.10. Companion Godot plugin must be installed and enabled in your Godot project (see the plugin README for setup).

Usage

import asyncio
from godot_cli_control import GameClient

async def main():
    async with GameClient(port=9877) as client:
        # Inspect scene
        tree = await client.get_scene_tree(depth=3)
        print(tree)

        # Interact
        await client.click("/root/MyScene/Button")
        await client.action_press("jump")
        await client.wait_game_time(0.5)
        await client.action_release("jump")

        # Capture
        png_bytes = await client.screenshot()
        open("frame.png", "wb").write(png_bytes)

asyncio.run(main())

CLI

python -m godot_cli_control tree 3
python -m godot_cli_control click /root/MyScene/Button
python -m godot_cli_control screenshot /tmp/frame.png

Documentation

See the Godot plugin README for the full RPC reference, activation modes, security model, and known limitations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

godot_cli_control-0.1.4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

godot_cli_control-0.1.4-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file godot_cli_control-0.1.4.tar.gz.

File metadata

  • Download URL: godot_cli_control-0.1.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for godot_cli_control-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a434d452a201e62e3d773a0f9065da5f5c527fa857b686894342c875b2267dc6
MD5 d16ca461633f64dba2573d8a42ea6018
BLAKE2b-256 82957c39d38371accb5a139fa29e0cb740bba93875bd64e766ffe87b44c6f21a

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_cli_control-0.1.4.tar.gz:

Publisher: release.yml on ClaymanTwinkle/godot-cli-control

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file godot_cli_control-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for godot_cli_control-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9881a3c83dae309380303071b46b268221735a7ad2b9b80730603808c0449b40
MD5 11f3bd7de065093dea8254aaa7071a2a
BLAKE2b-256 6fe2b724163b0306499e8cbfd856bc48714e67fd8d706e8b0cd96d13140fa6a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_cli_control-0.1.4-py3-none-any.whl:

Publisher: release.yml on ClaymanTwinkle/godot-cli-control

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page