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.5.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.5-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: godot_cli_control-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 f8364979e65710a8ead6a9200af5a377bb479737a98103c60399daa59775222c
MD5 c7a2da8d93ada5a654923b0e0e8870dd
BLAKE2b-256 1886cf2d464ba572342b257c465d5f298d17501c917184f17651475b112688ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_cli_control-0.1.5.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.5-py3-none-any.whl.

File metadata

File hashes

Hashes for godot_cli_control-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef81670b12fffe439c2e936559bdf0323a755700c62e3e3b1c15323c32b2c12
MD5 c39f4751f328400dde0723ec03fb41ef
BLAKE2b-256 4cecbe6738d6cc3d0be59456273a239b070ff7e85441949377593ab1a7fbcc11

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_cli_control-0.1.5-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