Using the CLI
The Sendama CLI is the main tool for creating projects, opening the editor, running the game, and generating content files. This guide covers the day-to-day workflows you will reach for most.
Install The CLI
Install it globally with Composer:
composer global require sendamaphp/console
Confirm the install:
sendama --version
Make sure your global Composer bin directory is on your PATH. On most systems it is at ~/.composer/vendor/bin or ~/.config/composer/vendor/bin.
Create A New Project
sendama new my-game
cd my-game
composer install
new is the short alias for new:game and creates the standard project layout under my-game/, including Assets/, sendama.json, and a bootstrap entry file.
Open The Editor
From inside the project directory:
sendama edit
Or point at a project from anywhere:
sendama edit --directory /path/to/my-game
The editor looks for sendama.json and an Assets folder. If common files are missing it can normalize the project for you.
Run The Game
sendama play
Or from outside the project:
sendama play --directory /path/to/my-game
The most effective loop during active development is to keep the editor and runtime in separate terminals:
# terminal 1 — authoring
sendama edit
# terminal 2 — testing
sendama play
Save scene changes with Ctrl+S in the editor before switching to the runtime to pick them up.
Generate Content Files
Use generator commands to create new scenes, prefabs, scripts, and other assets without leaving the terminal:
sendama generate:scene level02
sendama generate:prefab enemy-bullet
sendama generate:script player-controller
sendama generate:texture player
sendama generate:tilemap level02
sendama generate:tileset dungeon
sendama generate:splash-screen loading
Each command writes the appropriate file to the correct folder under Assets/. You can also trigger generators from the Assets panel inside the editor if you prefer to stay in the editor context.
View Project Logs
sendama view:log
This tails the current project's logs/debug.log and logs/error.log. The same output is also visible in the editor's Console panel while the editor is open.
Update The CLI
sendama update
This updates the CLI and its bundled tooling to the latest version. Run it periodically to pick up new generator templates and editor improvements.
What The CLI Does Not Cover
Some project tasks live outside the CLI:
- Gameplay scripting is written in PHP directly in
Assets/Scripts/. See Scripting Basics. - Input and trigger logic are covered in Input, Collisions, and Triggers.
- Scene and asset editing is done inside the editor. See Editor Workflow and Scene Authoring Basics.
- Project configuration (
sendama.json,config/input.php) is edited by hand. See Project Organization.
For the full command and flag reference, see the CLI Commands page in the API Reference.