Communitygithub.com

s&box CLI

CLI natif pour le moteur de jeu s&box (Facepunch Studios, Source 2). Plus de 79 commandes réparties dans 14 groupes. Manipulez directement les fichiers JSON `.scene`, `.prefab`, `.vmat`, `.sound`, `Input.config`, `Collision.config`, générez des composants C# idiomatiques et exécutez un graphe d'actifs en temps réel sur le projet.

Qu'est-ce que s&box CLI ?

Cette compétence fournit une interface en ligne de commande complète et native pour le moteur de jeu s&box, basée sur une architecture de 79+ commandes organisées en 14 groupes fonctionnels. Elle permet aux agents IA de manipuler directement les fichiers JSON du projet (scènes, préfabriqués, matériaux, sons, configurations d'entrée et de collision), de générer du code C# idiomatique (composants, ressources de jeu, UI Razor, etc.), et d'effectuer des opérations avancées comme le diff structurel entre scènes, la recherche de références d'actifs, le renommage et le déplacement d'actifs avec mise à jour automatique de toutes les références. Principales capacités : gestion complète des projets (création, configuration, validation), manipulation de scènes et préfabriqués (ajout/suppression d'objets, de composants, modification de propriétés, interrogation par filtres, modifications en masse), génération de code C# structuré (composants avec propriétés, composants réseau avec RPC, ressources de jeu, menus d'édition, composants UI Razor), gestion des entrées et collisions, gestion des matériaux et sons, localisation, et exécution de serveurs dédiés. Elle fonctionne entièrement sur les fichiers JSON du projet, sans nécessiter que s&box soit en cours d'exécution pour la plupart des commandes, ce qui la rend idéale pour les pipelines CI/CD et l'intégration avec des agents IA. L'outil détecte automatiquement l'installation de s&box via Steam et peut être configuré via des variables d'environnement.

Compatible avec✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-sbox

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

CLI s&box

Interface en ligne de commande native pour le moteur de jeu s&box (Facepunch Studios, Source 2). 79+ commandes réparties en 14 groupes. Manipulez directement les fichiers JSON .scene, .prefab, .vmat, .sound, Input.config, Collision.config, générez des composants C# idiomatiques et exécutez un graphe d'actifs en temps réel sur le projet.

Installation

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

Prérequis

  • Python 3.10+
  • s&box installé via Steam – détection automatique, ou définissez SBOX_PATH pour un répertoire d'installation personnalisé.
  • La plupart des commandes fonctionnent entièrement sur les fichiers JSON du projet – s&box n'a pas besoin d'être en cours d'exécution.

Options globales

--json          Sortie JSON lisible par machine (toujours passer pour une utilisation par agent)
--project PATH  Répertoire du projet (détection automatique depuis le cwd si un fichier .sbproj s'y trouve)

Groupes de commandes

project - Gérer les projets s&box

cli-anything-sbox project new --name MyGame --output-dir ./MyGame
cli-anything-sbox --json project info
cli-anything-sbox project config --max-players 32 --tick-rate 64
cli-anything-sbox --json --project ./MyGame project add-package facepunch.libsdf
cli-anything-sbox --json --project ./MyGame project remove-package facepunch.libsdf
# Vérification : références d'actifs cassées, GUID en double, Input.config mal formé
cli-anything-sbox --json --project ./MyGame project validate
cli-anything-sbox --project ./MyGame project validate --no-inputs --no-guids

scene - Manipuler les fichiers .scene

cli-anything-sbox scene new --name gameplay -o ./Assets/scenes/gameplay.scene
cli-anything-sbox --json scene info ./scene.scene
cli-anything-sbox --json scene list ./scene.scene
cli-anything-sbox scene add-object ./scene.scene Enemy --position "100,0,0" --components "model,box_collider,rigidbody" --tags "enemy"
cli-anything-sbox scene remove-object ./scene.scene --name Enemy
cli-anything-sbox scene add-component ./scene.scene <object-guid> Sandbox.PointLight
cli-anything-sbox scene remove-component ./scene.scene <object-guid> --component-type Sandbox.Rigidbody
cli-anything-sbox --json scene modify-object ./scene.scene --guid <guid> --name NewName --position "200,0,0"
cli-anything-sbox --json scene clone-object ./scene.scene --name Enemy --new-name EnemyCopy --position "300,0,0"
cli-anything-sbox --json scene get-object ./scene.scene --name Sun
cli-anything-sbox scene set-property ./scene.scene --fixed-update-freq 64 --timescale 0.5
cli-anything-sbox scene set-navmesh ./scene.scene --enabled --agent-height 72 --agent-radius 16
cli-anything-sbox --json scene list-presets
cli-anything-sbox --json scene modify-component ./scene.scene <object-guid> <component-guid> --properties '{"Damage":50}'

# Trouver des objets correspondant à un ou plusieurs filtres (combinés avec ET)
cli-anything-sbox --json scene query ./scene.scene --has-component rigidbody --has-tag tower
cli-anything-sbox --json scene query ./scene.scene --name-regex "^Tower\d$" --in-bounds "0,-500,-50,1000,500,50"

# Extraire chaque référence d'actif (.vmdl, .vmat, .vsnd, .vtex, .vpcf, .prefab) d'une scène
cli-anything-sbox --json scene refs ./scene.scene

# Appliquer la même modification à chaque objet correspondant à une requête
cli-anything-sbox --json scene bulk-modify ./scene.scene --has-tag tower --position "0,0,100" --enable

# Diff structurel entre deux scènes (GameObjects ajoutés/supprimés/modifiés + SceneProperties)
cli-anything-sbox --json scene diff ./old.scene ./new.scene

# Insérer un préfabriqué en tant que GameObject dans une scène
cli-anything-sbox --json scene instantiate-prefab ./level.scene ./Assets/prefabs/bullet.prefab --position "10,0,0"

prefab - Gérer les fichiers .prefab

cli-anything-sbox prefab new --name Bullet -o ./Assets/prefabs/bullet.prefab --components "model,sphere_collider,rigidbody"
cli-anything-sbox --json prefab info ./Assets/prefabs/bullet.prefab
cli-anything-sbox prefab from-scene ./scene.scene <object-guid> -o ./Assets/prefabs/extracted.prefab
cli-anything-sbox --json prefab add-component ./prefab.prefab rigidbody
cli-anything-sbox prefab remove-component ./prefab.prefab --component-type Sandbox.Rigidbody
cli-anything-sbox --json prefab list

# Références d'actifs à l'intérieur d'un préfabriqué
cli-anything-sbox --json prefab refs ./prefab.prefab

# Modifier les propriétés d'un composant sur un préfabriqué (par type de composant ou GUID de composant)
cli-anything-sbox --json prefab modify-component ./prefab.prefab --component-type Sandbox.Rigidbody --properties '{"Gravity":false,"MassOverride":50}'

# Diff structurel entre deux préfabriqués (racine + enfants nommés)
cli-anything-sbox --json prefab diff ./old.prefab ./new.prefab

codegen - Générer du code C#

# Composant simple
cli-anything-sbox codegen component --name PlayerController --methods OnUpdate,OnFixedUpdate -o ./Code/PlayerController.cs

# Composant avec champs [Property]
cli-anything-sbox --json codegen component --name Tower --properties '[{"name":"Damage","type":"float","default":"25f"},{"name":"Range","type":"float","default":"500f"}]'

# Composant réseau (classe partielle) avec des squelettes de méthodes RPC
cli-anything-sbox codegen component --name NetPlayer --networked --methods OnUpdate,OnFixedUpdate --rpc-methods "Fire:Broadcast,TakeDamage:Host" -o ./Code/NetPlayer.cs

# GameResource
cli-anything-sbox codegen gameresource --name TowerData --display-name "Tower Data" --extension tower -o ./Code/TowerData.cs

# Menu d'éditeur (assembly Editor/)
cli-anything-sbox codegen editor-menu --name MyTools --menu-path "Editor/My Tools/Open" -o ./Editor/MyTools.cs

# Composant d'interface utilisateur Razor simple (.razor + .razor.scss)
cli-anything-sbox codegen razor --name HudPanel --properties '[{"name":"Score","type":"int","default":"0"}]' -o ./UI/HudPanel.razor

# Classe statique ou dérivée d'une classe de base
cli-anything-sbox codegen class --name Math2 --static -o ./Code/Math2.cs

# PanelComponent + échafaudage ScreenPanel associé (gère la particularité de s&box où
# l'entrée PanelComponent ne fonctionne que lorsque les deux sont sur le même GameObject).
# Émet .razor + .razor.scss + un extrait GameObject prêt à coller, ou ajoute
# directement à une scène avec --scene.
cli-anything-sbox --json codegen panel-component --name HudBar -o ./UI/HudBar.razor
cli-anything-sbox codegen panel-component --name Crosshair -o ./UI/Crosshair.razor --scene ./Assets/scenes/game.scene

input - Gérer Input.config

cli-anything-sbox --json input list
cli-anything-sbox input add --name PlaceTower --group Gameplay --keyboard mouse1 --gamepad RightTrigger
cli-anything-sbox input remove --name PlaceTower
cli-anything-sbox input set --name Attack1 --keyboard mouse1

collision - Gérer Collision.config

cli-anything-sbox --json collision list
cli-anything-sbox collision add-layer --name projectile --default Collide
cli-anything-sbox collision add-rule --layer-a projectile --layer-b solid --result Collide
cli-anything-sbox collision remove-rule --layer-a projectile --layer-b solid
cli-anything-sbox collision remove-layer --name projectile

material - Gérer les matériaux .vmat

cli-anything-sbox --json material new --name floor --shader complex --color-texture "textures/floor.tga" --metalness 0.3 -o ./Assets/materials/floor.vmat
cli-anything-sbox --json material info ./Assets/materials/floor.vmat
cli-anything-sbox --json material list
cli-anything-sbox --json material set ./Assets/materials/floor.vmat --metalness 0.8

sound - Gérer les événements sonores .sound

cli-anything-sbox --json sound new --name gunshot --sounds "sounds/gun1.vsnd,sounds/gun2.vsnd" --volume 0.8 -o ./Assets/sounds/gunshot.sound
cli-anything-sbox --json sound info ./Assets/sounds/gunshot.sound
cli-anything-sbox --json sound list
cli-anything-sbox --json sound set ./Assets/sounds/gunshot.sound --volume 0.5

localization - Gérer les traductions

cli-anything-sbox localization new --lang en -o ./Localization/en.json
cli-anything-sbox localization set ./Localization/en.json --key "game.title" --value "My Game"
cli-anything-sbox --json localization list ./Localization/en.json
cli-anything-sbox localization get ./Localization/en.json --key "game.title"
cli-anything-sbox localization remove ./Localization/en.json --key "game.title"
cli-anything-sbox localization bulk-set ./Localization/en.json --keys '{"ui.start":"Start","ui.quit":"Quit"}'

server - Serveur dédié

cli-anything-sbox server info
cli-anything-sbox server start --game my_game --map facepunch.flatgrass

asset - Gestion des actifs et recherches inverses

cli-anything-sbox --json asset list --type scene
cli-anything-sbox --json asset info ./Assets/scenes/minimal.scene
cli-anything-sbox asset compile ./Assets/materials/floor.vmat

# Quelles scènes/préfabriqués référencent cet actif ?
cli-anything-sbox --json --project ./MyGame asset find-refs models/myteam/widget.vmdl

# Trouver les actifs non référencés (par type, ou dans tous les types référençables)
cli-anything-sbox --json --project ./MyGame asset find-unused
cli-anything-sbox --json --project ./MyGame asset find-unused --type model --type material

# Renommer un actif et mettre à jour chaque référence de scène/préfabriqué (extension conservée si omise)
cli-anything-sbox --json --project ./MyGame asset rename models/team/widget.vmdl gizmo
cli-anything-sbox --project ./MyGame asset rename models/team/widget.vmdl gizmo --dry-run

# Déplacer un actif entre répertoires et mettre à jour chaque référence
cli-anything-sbox --json --project ./MyGame asset move models/team/widget.vmdl models/shared/widget.vmdl

session - Gestion d'état

cli-anything-sbox session status
cli-anything-sbox session undo
cli-anything-sbox session redo

test - Harnais automatisé de génération de carte/scène

cli-anything-sbox test setup
cli-anything-sbox --json test run

launch - Ouvrir le projet dans l'éditeur s&box

cli-anything-sbox launch

Presets de composants

29 noms courts utilisables avec --components sur scene add-object, prefab new, etc. Chacun correspond à un type de composant Sandbox.*.

PresetType de composant
modelSandbox.ModelRenderer
box_colliderSandbox.BoxCollider
sphere_colliderSandbox.SphereCollider
capsule_colliderSandbox.CapsuleCollider
plane_colliderSandbox.PlaneCollider
model_colliderSandbox.ModelCollider
rigidbodySandbox.Rigidbody
character_controllerSandbox.CharacterController
player_controllerSandbox.PlayerController
cameraSandbox.CameraComponent
light_directionalSandbox.DirectionalLight
light_pointSandbox.PointLight
spot_lightSandbox.SpotLight
ambient_lightSandbox.AmbientLight
sprite_rendererSandbox.SpriteRenderer
skinned_model_rendererSandbox.SkinnedModelRenderer
text_rendererSandbox.TextRenderer
line_rendererSandbox.LineRenderer
decal_rendererSandbox.DecalRenderer
trail_rendererSandbox.TrailRenderer
particle_effectSandbox.ParticleEffect
sound_pointSandbox.SoundPointComponent
nav_mesh_agentSandbox.NavMeshAgent
screen_panelSandbox.ScreenPanel
world_panelSandbox.WorldPanel
fixed_jointSandbox.FixedJoint
hinge_jointSandbox.HingeJoint
spring_jointSandbox.SpringJoint
ball_socket_jointSandbox.BallSocketJoint

scene list-presets retourne le registre des presets en direct au format JSON.

Modèle d'utilisation pour agent

Passez l'option --json pour chaque invocation pilotée par un agent. Utilisez jq pour chaîner les GUID et les chemins entre les commandes :

# Amorcer un projet
sbproj=$(cli-anything-sbox --json project new --name MyGame --output-dir /tmp/MyGame | jq -r '.sbproj')
cd /tmp/MyGame

# Ajouter une tour avec une disposition de composants spécifique, capturer son GUID
guid=$(cli-anything-sbox --json scene add-object ./Assets/scenes/main.scene Tower \
    --components "model,box_collider,rigidbody" --tags "tower" \
    | jq -r '.guid')

# Générer le composant C# correspondant, en réseau
cli-anything-sbox --json codegen component --name Tower --networked \
    --rpc-methods "Fire:Host" --properties '[{"name":"Damage","type":"float","default":"25f"}]' \
    -o ./Code/Tower.cs

# Modification en masse de chaque tour dans la scène
cli-anything-sbox --json scene bulk-modify ./Assets/scenes/main.scene \
    --has-tag tower --enable --position-y-add 50

# Valider avant de valider
cli-anything-sbox --json project validate

Mode REPL

cli-anything-sbox sans argument entre dans un REPL interactif avec une invite stylisée :

$ cli-anything-sbox
cli-anything-sbox> project info
cli-anything-sbox> scene list ./Assets/scenes/main.scene
cli-anything-sbox> codegen component --name Foo -o ./Code/Foo.cs
cli-anything-sbox> quit

Variables d'environnement

VariableDescriptionPar défaut
SBOX_PATHRépertoire d'installation de s&boxDétection automatique à partir des dossiers de bibliothèque Steam
CLI_ANYTHING_SKILL_REPORemplace le dépôt que repl_skin lit SKILL.mdHKUDS/CLI-Anything

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

Skills associés