CLICommands
ecs
snug ecs <COMMAND>Entity Component System operations.
Subcommands
| Command | What it does |
|---|---|
schema | Schema management commands |
entity | Entity management commands |
component | Component management commands |
query | Query entities |
archetype | Archetype management commands |
hierarchy | Parent/child hierarchy commands |
resource | Resource management commands |
system | System management commands |
coordinator | Coordinator management commands |
subscription | Real-time subscription management commands |
Run snug ecs <command> --help for that command's own options.
The global options apply everywhere.
Examples
snug ecs schema create --type Position --version 1 --schema '{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}}}'
snug ecs schema list
snug ecs schema get --type Position
snug ecs schema delete --type Position --version 1 --force
snug ecs entity create -x game1 --id player1 --components '{"Health":{"current":100,"max":100}}' --tags player,active
snug ecs entity get -x game1 --id player1
snug ecs entity delete -x game1 --id player1
snug ecs entity batch-create -x game1 --entities '[{"entity_id":"npc1"},{"entity_id":"npc2"}]'
snug ecs entity batch-delete -x game1 --has-all Dead --limit 50 --force
snug ecs entity tags -x game1 --id player1 --tags player,vip
snug ecs component set -x game1 --entity player1 --type Position --data '{"x":10,"y":20}'
snug ecs component get -x game1 --entity player1 --type Position
snug ecs component remove -x game1 --entity player1 --type Position
snug ecs query -x game1 --has-all Position,Velocity --limit 10
snug ecs query -x game1 --has-any Health,Shield --has-none Dead
snug ecs query -x game1 --has-all Position --count
snug ecs archetype list -x game1
snug ecs archetype get -x game1 --hash a1b2c3d4
snug ecs hierarchy set-parent -x game1 --id sword1 --parent player1
snug ecs hierarchy children -x game1 --id player1
snug ecs hierarchy remove-parent -x game1 --id sword1
snug ecs resource create -x game1 --name GameConfig --data '{"gravity":9.8}'
snug ecs resource list -x game1
snug ecs resource get -x game1 --name GameConfig
snug ecs resource update -x game1 --name GameConfig --data '{"gravity":10.0}'
snug ecs resource delete -x game1 --name GameConfig
snug ecs system register -x game1 --name MovementSystem --has-all Position,Velocity --priority 100
snug ecs system list -x game1
snug ecs system get -x game1 --name MovementSystem
snug ecs system enable -x game1 --name MovementSystem
snug ecs system disable -x game1 --name MovementSystem
snug ecs system execution-order -x game1
snug ecs system execute -x game1 --name MovementSystem --dry-run
snug ecs system pause -x game1 --name MovementSystem
snug ecs system resume -x game1 --name MovementSystem
snug ecs system stats -x game1 --name MovementSystem
snug ecs coordinator status -x game1
snug ecs coordinator start -x game1 --tick-rate 100
snug ecs coordinator stop -x game1
snug ecs coordinator mutations -x game1 --mutations '[{"entity_id":"player1","set_components":{"Health":{"current":50}}}]'
snug ecs subscription create -x game1 --subscription-type entity --entity-id player1
snug ecs subscription create -x game1 --subscription-type component --component-type Health
snug ecs subscription create -x game1 --subscription-type query --query '{"has_all":["Position"],"has_any":[],"has_none":[],"filters":[]}'
snug ecs subscription list -x game1
snug ecs subscription delete -x game1 --subscription-id sub-abc123Next
- ecs guide - what the service does and when to reach for it.
- API reference - every endpoint these commands call.
- CLI reference - global options, output modes, and exit codes.