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.0.tar.gz (9.6 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.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: godot_cli_control-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for godot_cli_control-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6c46e9856c54df7479ea027e8b97af3e86e8e79500ecffc481df4d49b818b39
MD5 3c76511522911358f15b0682c3085b35
BLAKE2b-256 36e09605b641ff9fa92cbd2502dfe7d53590f53e09afe327b22f934ba28161e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for godot_cli_control-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b70fcc06c4879ab113fd8694b03c9b7c78b645f6b3238b0f744b51bc9178a633
MD5 96dfb71d6cc81e1bcf91be0ca5bde5ec
BLAKE2b-256 5e9803ab62386985252cb1619dd0e0a274efc881eb3c625b5c7b8bd9f8a4463b

See more details on using hashes here.

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