mcpField
C
cli-anything-godot

cli-anything-godot

github.com/hkuds开发57.6k556 次安装5 周前更新
代码仓库

关于 cli-anything-godot

cli-anything-godot 是面向 Agent 的 Godot 游戏项目命令行工具,涵盖项目与场景操作、GDScript 执行和验证,以及导出构建,并支持适用于 Agent 工作流的 JSON 输出。

主要功能

  1. 01创建和查看 Godot 项目
  2. 02读取和修改场景结构
  3. 03运行和验证 GDScript
  4. 04查看导出预设并构建导出包
  5. 05检查 Godot 是否可用及其版本
  6. 06输出结构化 JSON

适用场景

  1. 01创建 Godot 项目并查看场景
  2. 02向游戏场景添加节点
  3. 03运行或验证项目脚本
  4. 04使用已配置的预设构建导出包

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-godot

安装后在 Claude Code 中输入/cli-anything-godot确认已加载。

详细介绍

Godot Engine CLI

面向 Agent 的 Godot 游戏引擎命令行工具。可通过命令行管理项目、场景、导出以及 GDScript 执行。

安装

pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=godot/agent-harness

环境要求

  • PATH 中需包含 Godot 4.x(或设置 GODOT_BIN 环境变量)

命令

项目管理
# Create a new Godot project
cli-anything-godot project create <path> [--name "My Game"]

# Get project info (name, features, main scene)
cli-anything-godot --json -p <project> project info

# List all scenes
cli-anything-godot --json -p <project> project scenes

# List all scripts
cli-anything-godot --json -p <project> project scripts

# List all resources
cli-anything-godot --json -p <project> project resources

# Re-import project resources
cli-anything-godot -p <project> project reimport
场景操作
# Create a new scene with root node type
cli-anything-godot -p <project> scene create scenes/Level1.tscn --root-type Node3D

# Read scene structure (nodes, resources, connections)
cli-anything-godot --json -p <project> scene read scenes/Level1.tscn

# Add a child node to a scene
cli-anything-godot -p <project> scene add-node scenes/Level1.tscn --name Player --type CharacterBody3D --parent .
GDScript 执行
# Run a GDScript file (must extend SceneTree)
cli-anything-godot -p <project> script run tools/build_navmesh.gd

# Run inline GDScript code
cli-anything-godot -p <project> script inline 'print(ProjectSettings.get_setting("application/config/name"))'

# Validate GDScript syntax
cli-anything-godot -p <project> script validate scripts/player.gd
导出
# List configured export presets
cli-anything-godot --json -p <project> export presets

# Export all presets
cli-anything-godot -p <project> export build

# Export a specific preset
cli-anything-godot -p <project> export build --preset "Windows Desktop" --output build/game.exe
引擎
# Check Godot availability and binary path
cli-anything-godot --json engine status

# Get engine version
cli-anything-godot engine version

JSON 模式

为任意命令添加 --json 标志,即可获得适合 Agent 使用的结构化 JSON 输出:

cli-anything-godot --json -p ./my-game project info

交互式 REPL

cli-anything-godot -p ./my-game session

评论

支持 Markdown