Command reference
This is a reference for the current development CLI and native harness. Begin with project setup before using it as a checklist of commands to run. Not every command is appropriate for an ordinary game project.
CLI conventions
The executable is AIGameEngine. Command and flag spelling matters. The CLI uses a small argument parser rather than a conventional generated help system; there is no implemented general help or serve subcommand in this snapshot.
--project PATHselects a game for build/run/managed-play operations; otherwise the current directory is used.ctltakes its project/address selector as a positional argument.--engine PATHselects an engine checkout where supported; otherwise engine resolution usesAIGAME_ENGINEand then the compiled source location.- Value flags require a following argument. Boolean flags such as
--release,--fix,--apply,--dry-run,--push,--no-buildand--yes-copydo not take a separate value. --versionreports the CLI package version; it is not a compatibility check for every game or website download.
Use explicit paths while learning, especially when the engine and game are separate folders. The examples below assume the tutorial folder layout.
Ordinary game workflows
| Command shape | Purpose | Details |
|---|---|---|
AIGameEngine --version |
Report version | Does not inspect a game's dependency revision |
AIGameEngine new PATH --name NAME --engine ENGINE |
Scaffold a new Rust game | Use an empty, disposable destination; not a finished sample game |
AIGameEngine spec-check FILE |
Check the specification's structure/keywords | Does not evaluate whether a game implements it |
AIGameEngine build --project PATH |
Build the host development game | Asset files remain part of the development workflow |
AIGameEngine build --project PATH --release |
Build an embedded-asset host release | Requires the game's embedding feature forwarding |
AIGameEngine build --project PATH --target TARGET --release |
Select a package/build target | See the target table in export |
AIGameEngine run --project PATH |
Run through development Cargo | Not a release-package launcher |
AIGameEngine list-assets --library PATH |
Open a temporary local asset listing | Not an importer/editor |
AIGameEngine library add FILE CATEGORY --library PATH |
Validate and copy into a library category | Can replace a same-named destination; not format conversion |
AIGameEngine sfx ID --out PATH --prefix PREFIX --seed N |
Render a sound recipe to raw PCM | Start with ui-click; see audio |
AIGameEngine music ID --out PATH --prefix PREFIX --soundfont FILE |
Render music to Opus | External tools and a soundfont required; sting-victory is a known generic ID |
The recognized build targets are host, linux, windows, mac, appimage, android, ios, web and the multi-target selector all. An aggregate success is not proof every target succeeded.
Diagnostic launch and capture
| Command shape | Purpose | Conditions |
|---|---|---|
AIGameEngine ctl PROJECT COMMAND... |
Send a command to an enabled native harness | Project-derived address or explicit supported address; game already running |
AIGameEngine play --project PATH --script FILE |
Launch a managed virtual-display session and execute harness commands | Linux helper/tool prerequisites; not attach; closes its process afterward |
AIGameEngine shot --project PATH --out FILE |
CLI-managed screenshot workflow | Virtual-display/helper prerequisites; not the same as sending shot to an existing harness |
For a persistent interactive window, use the launch-and-ctl sequence in inspection. Manage one helper session at a time. Check errors in replies as well as CLI process status.
Native harness protocol
These are protocol lines passed after the project selector in ctl, or placed in a harness script. They are not shell commands on their own.
| Protocol form | Meaning |
|---|---|
pause |
Pause game updates |
play or resume |
Resume game updates |
step n |
Positive n pauses, advances n updates and remains paused |
wait n |
Advance updates while preserving playing/paused status |
state |
Return game-defined state or the default narrow snapshot |
frame path |
Write game-defined textual frame; default text is empty |
shot path |
Capture after rendering; relative to game working directory |
load JSON |
Restore through the game's load hook; JSON is inline, not a filename |
quit or exit |
Request native game exit |
k KEY d / k KEY u / k KEY t |
Key down, up or tap |
tap KEY |
Key tap alias |
m x y |
Set mouse position |
md dx dy |
Add relative mouse movement |
mb L d / mb L u / mb L t |
Left mouse button action; R and M select right/middle |
sc value |
Scroll input |
pad lx value |
Set pad axis; also ly, rx, ry |
pad A d |
Pad button action; use u or t for up/tap |
t0 x y d |
Touch contact 0; t0 through t9, actions d, m, u |
drag x0 y0 x1 y1 n |
Scripted pointer drag over updates |
Command, axis and action tokens are case-sensitive. The supported pad button names are case-insensitive: A, B, X, Y, LB, RB, LT, RT, L3, R3, start, select, mode, up, down, left, right.
Key names come from an explicit supported list, not arbitrary display text. The tutorials use known names ArrowRight and Escape. Modifier names can map specifically to a left-side key; do not infer every left/right variant is supported.
Axes clamp to -1 through 1. Numeric inputs must be finite; update counts are unsigned with a maximum of 1,000,000. A zero-length drag is treated as one update. step 0 acknowledges without pausing.
Input and reply rules
- Down remains held until an up action or the appropriate tap release; disconnect does not clear it.
- A tap releases after the next update, so it does not advance a paused game by itself.
- Injected pad input takes over the pad state for that input instance; there is no generic reset-to-hardware command.
- Human window events can still affect a controlled native session.
- Replies are
ok,err ...or state text. A printed server error does not necessarily givectla failing shell exit status. - The CLI semicolon splitter is not JSON-aware. Prefer separate calls, and do not use that shorthand for payloads/paths containing semicolons.
- A text-frame write or screenshot can replace an existing file. Missing parent directories are not created.
See timing and snapshot limits before building automation around these commands.
Optional maintenance and operator tools
research, learn, refactor, prune and tag are described in working with an assistant. Some mutate files or repository history. Their names are not permission to run them across an unfamiliar project.
site and deploy are engine-site publishing/operator workflows, not required game-export steps. Even an unpushed deployment performs local writes and checks. Configure and authorize them separately rather than using them to test an ordinary game.