CLI Moteur Godot
CLI natif pour agent du moteur de jeu Godot. Gérez les projets, scènes, exports et l'exécution GDScript depuis la ligne de commande.
Installation
pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=godot/agent-harness
Prérequis
- Godot 4.x dans le PATH (ou définir la variable d'environnement
GODOT_BIN)
Commandes
Gestion de projet
# Créer un nouveau projet Godot
cli-anything-godot project create <chemin> [--name "Mon Jeu"]
# Obtenir les informations du projet (nom, fonctionnalités, scène principale)
cli-anything-godot --json -p <projet> project info
# Lister toutes les scènes
cli-anything-godot --json -p <projet> project scenes
# Lister tous les scripts
cli-anything-godot --json -p <projet> project scripts
# Lister toutes les ressources
cli-anything-godot --json -p <projet> project resources
# Réimporter les ressources du projet
cli-anything-godot -p <projet> project reimport
Opérations sur les scènes
# Créer une nouvelle scène avec un type de nœud racine
cli-anything-godot -p <projet> scene create scenes/Niveau1.tscn --root-type Node3D
# Lire la structure de la scène (nœuds, ressources, connexions)
cli-anything-godot --json -p <projet> scene read scenes/Niveau1.tscn
# Ajouter un nœud enfant à une scène
cli-anything-godot -p <projet> scene add-node scenes/Niveau1.tscn --name Joueur --type CharacterBody3D --parent .
Exécution GDScript
# Exécuter un fichier GDScript (doit étendre SceneTree)
cli-anything-godot -p <projet> script run outils/build_navmesh.gd
# Exécuter du code GDScript en ligne
cli-anything-godot -p <projet> script inline 'print(ProjectSettings.get_setting("application/config/name"))'
# Valider la syntaxe GDScript
cli-anything-godot -p <projet> script validate scripts/joueur.gd
Exportation
# Lister les présélections d'exportation configurées
cli-anything-godot --json -p <projet> export presets
# Exporter toutes les présélections
cli-anything-godot -p <projet> export build
# Exporter une présélection spécifique
cli-anything-godot -p <projet> export build --preset "Bureau Windows" --output build/game.exe
Moteur
# Vérifier la disponibilité de Godot et le chemin du binaire
cli-anything-godot --json engine status
# Obtenir la version du moteur
cli-anything-godot engine version
Mode JSON
Ajoutez le drapeau --json à n'importe quelle commande pour obtenir une sortie JSON structurée adaptée aux agents :
cli-anything-godot --json -p ./mon-jeu project info
REPL interactif
cli-anything-godot -p ./mon-jeu session