Communitygithub.com

s&box CLI

s&boxゲームエンジン(Facepunch Studios、Source 2)向けのエージェントネイティブCLI。14のグループに79以上のコマンドを提供し、.scene、.prefab、.vmat、.sound、Input.config、Collision.configのJSONファイルを直接操作し、慣用的なC#コンポーネントを生成し、プロジェクト全体でリアルタイムのアセットグラフを実行します。

s&box CLI とは?

s&box CLIは、AIエージェントがs&boxゲームエンジン(Source 2ベース)のプロジェクトを完全に管理・操作できるようにするコマンドラインツールです。インストールはpip経由で簡単に行え、Steamから自動検出されたs&boxインストールパスを利用するか、`SBOX_PATH`環境変数でカスタムパスを指定できます。ほとんどのコマンドはプロジェクト内のJSONファイル(.scene、.prefab、.vmat、.sound、Input.config、Collision.config)を直接操作するため、s&boxエンジン自体を実行する必要はありません。これにより、エンジンに依存しない高速なバッチ処理やCI/CDパイプラインへの統合が可能です。 CLIはプロジェクト管理、シーン編集、プレハブ操作、C#コード生成、入力設定、衝突設定、マテリアル編集、サウンド管理、ローカライゼーション、サーバー管理、アセット管理、状態管理、自動テスト、エディタ起動の14のコマンドグループで構成されています。各コマンドは`--json`フラグに対応しており、エージェントはJSON出力をjqなどでパイプ処理することで、GUIDやパスを効率的に連鎖させることができます。特にcodegenグループは、C#コンポーネント(ネットワーク対応、RPCメソッドスタブ付き)、GameResource、エディタメニュー、Razor UI、PanelComponent(シーンへの直接追加機能付き)など、s&box開発に必要なコードテンプレートを生成します。 同梱されている29のコンポーネントプリセットにより、`scene add-object`や`prefab new`などのコマンドで、短い名前(例:`box_collider`)を使って`Sandbox.*`型のコンポーネントを簡単に追加できます。`scene query`と`scene bulk-modify`の組み合わせにより、条件に一致するオブジェクトへの一括編集が強力に実行でき、`scene diff`や`prefab diff`で構造的な差分を確認できます。また、引数なしで起動するREPLモードも提供されており、対話的な操作も可能です。

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

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

s&box CLI は何をしますか?

s&boxゲームエンジン(Facepunch Studios、Source 2)向けのエージェントネイティブCLI。14のグループに79以上のコマンドを提供します。.scene、.prefab、.vmat、.sound、Input.config、Collision.configのJSONファイルを直接操作し、慣用的なC#コンポーネントを生成し、プロジェクト全体でリアルタイムのアセットグラフを実行します。

インストール

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

要件

  • Python 3.10+
  • Steam経由でインストールされたs&box - 自動検出されます。または、SBOX_PATHでカスタムインストールディレクトリを設定します。
  • ほとんどのコマンドはプロジェクトのJSONファイル上で完全に動作します - s&boxが実行されている必要はありません。

グローバルオプション

--json          機械可読なJSON出力(エージェント使用時は常に指定)
--project PATH  プロジェクトディレクトリ(省略時はカレントディレクトリの.sbprojから自動検出)

コマンドグループ

project - 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
# リンター:壊れたアセット参照、重複GUID、不正なInput.config
cli-anything-sbox --json --project ./MyGame project validate
cli-anything-sbox --project ./MyGame project validate --no-inputs --no-guids

scene - .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}'

# 1つ以上のフィルターに一致するオブジェクトを検索(AND結合)
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"

# シーンからすべてのアセット参照(.vmdl、.vmat、.vsnd、.vtex、.vpcf、.prefab)を抽出
cli-anything-sbox --json scene refs ./scene.scene

# クエリに一致するすべてのオブジェクトに同じ変更を適用
cli-anything-sbox --json scene bulk-modify ./scene.scene --has-tag tower --position "0,0,100" --enable

# 2つのシーン間の構造的差分(追加/削除/変更されたGameObject + SceneProperties)
cli-anything-sbox --json scene diff ./old.scene ./new.scene

# プレハブをシーン内のGameObjectとして挿入
cli-anything-sbox --json scene instantiate-prefab ./level.scene ./Assets/prefabs/bullet.prefab --position "10,0,0"

prefab - .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

# プレハブ内のアセット参照
cli-anything-sbox --json prefab refs ./prefab.prefab

# プレハブ上のコンポーネントプロパティを変更(コンポーネントタイプまたはコンポーネントGUIDで指定)
cli-anything-sbox --json prefab modify-component ./prefab.prefab --component-type Sandbox.Rigidbody --properties '{"Gravity":false,"MassOverride":50}'

# 2つのプレハブ間の構造的差分(ルート + 名前付き子)
cli-anything-sbox --json prefab diff ./old.prefab ./new.prefab

codegen - C#コードの生成

# プレーンなComponent
cli-anything-sbox codegen component --name PlayerController --methods OnUpdate,OnFixedUpdate -o ./Code/PlayerController.cs

# [Property] フィールドを持つComponent
cli-anything-sbox --json codegen component --name Tower --properties '[{"name":"Damage","type":"float","default":"25f"},{"name":"Range","type":"float","default":"500f"}]'

# ネットワーク対応コンポーネント(部分クラス)と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

# エディタメニュー(Editor/アセンブリ)
cli-anything-sbox codegen editor-menu --name MyTools --menu-path "Editor/My Tools/Open" -o ./Editor/MyTools.cs

# プレーンなRazor UIコンポーネント(.razor + .razor.scss)
cli-anything-sbox codegen razor --name HudPanel --properties '[{"name":"Score","type":"int","default":"0"}]' -o ./UI/HudPanel.razor

# 静的クラスまたは基本クラス派生
cli-anything-sbox codegen class --name Math2 --static -o ./Code/Math2.cs

# PanelComponent + 兄弟ScreenPanelのスキャフォールド(s&boxの癖を処理:PanelComponentの入力は、両方が同じGameObject上にある場合にのみ機能)。
# .razor + .razor.scss + ペースト可能なGameObjectスニペットを出力するか、--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 - 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 - 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 - .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 - .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 - 翻訳の管理

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 - 専用サーバー

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

asset - アセット管理と逆引き参照

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

# このアセットを参照しているシーン/プレハブは?
cli-anything-sbox --json --project ./MyGame asset find-refs models/myteam/widget.vmdl

# 未参照のアセットを検索(タイプごと、または全参照可能タイプ)
cli-anything-sbox --json --project ./MyGame asset find-unused
cli-anything-sbox --json --project ./MyGame asset find-unused --type model --type material

# アセットの名前を変更し、すべてのシーン/プレハブ参照を更新(拡張子を省略すると保持)
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

# アセットをディレクトリ間で移動し、すべての参照を更新
cli-anything-sbox --json --project ./MyGame asset move models/team/widget.vmdl models/shared/widget.vmdl

session - 状態管理

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

test - 自動マップ/シーン生成ハーネス

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

launch - s&boxエディタでプロジェクトを開く

cli-anything-sbox launch

コンポーネントプリセット

scene add-object、prefab newなどで--componentsと共に使用可能な29の短い名前。それぞれがSandbox.*コンポーネントタイプにマッピングされます。

プリセットコンポーネントタイプ
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は、ライブプリセットレジストリをJSONとして返します。

エージェント使用パターン

エージェント駆動の呼び出しでは、必ず--jsonを渡してください。jqを介してパイプし、GUIDとパスをコマンド間で連鎖させます:

# プロジェクトをブートストラップ
sbproj=$(cli-anything-sbox --json project new --name MyGame --output-dir /tmp/MyGame | jq -r '.sbproj')
cd /tmp/MyGame

# 特定のコンポーネントレイアウトでタワーを追加し、そのGUIDをキャプチャ
guid=$(cli-anything-sbox --json scene add-object ./Assets/scenes/main.scene Tower \
    --components "model,box_collider,rigidbody" --tags "tower" \
    | jq -r '.guid')

# 対応するC#コンポーネントを生成(ネットワーク対応)
cli-anything-sbox --json codegen component --name Tower --networked \
    --rpc-methods "Fire:Host" --properties '[{"name":"Damage","type":"float","default":"25f"}]' \
    -o ./Code/Tower.cs

# シーン内のすべてのタワーを一括調整
cli-anything-sbox --json scene bulk-modify ./Assets/scenes/main.scene \
    --has-tag tower --enable --position-y-add 50

# コミット前に検証
cli-anything-sbox --json project validate

REPLモード

cli-anything-sboxを引数なしで実行すると、スタイル付きプロンプトの対話型REPLが起動します:

$ 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

環境変数

変数説明デフォルト
SBOX_PATHs&boxインストールディレクトリSteamライブラリフォルダから自動検出
CLI_ANYTHING_SKILL_REPOrepl_skinがSKILL.mdを読み取るリポジトリを上書きHKUDS/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

>-

関連スキル