← Set up the CLI

Phaser AE

The Phaser AE CLI

CLI reference.

@phaser-ae/cli on npm: what it needs, how it signs in, what it writes to your computer, and every command.

Running it

Node.js, and nothing else.

Needs
Node.js 20 or later. The CLI has no dependencies of its own: only Node and its built-ins. Signing in needs a phaser.io account.
Without installing
npx -y @phaser-ae/cli <command>npx fetches the latest version from npm
Installed
npm install -g @phaser-ae/clithen: phaser-ae <command>
In a game's folder
The folder keeps its own copy of the CLI, in phaser/cli, and its commands are npm scripts: npm run -s build, npm run -s publish -- "…" and the rest, below. phaser-ae update brings that copy and the engine up to date.
License
MIT, for the CLI. It doesn't cover the Phaser AE engine or the expansion packs the CLI downloads.

Signing in

Your browser, once.

When
Any command that needs phaser.io signs in first if it has to; one whose token is refused signs in again, once. login does it on purpose.
How
Your browser opens at phaser.io/account/agent/connect: sign in (or make an account) and approve Phaser AE. The page hands the token back to a one-off server the CLI runs on 127.0.0.1, which waits up to ten minutes.
While it waits
A command waits 100 seconds in an agent's shell, or five minutes at a terminal, then stops and says to approve and run it again. A command run meanwhile joins the same sign-in.
Where it's kept
~/.config/phaser-ae/config.json, readable only by you (PHASER_AE_HOME moves the folder). For the engine and the packs, the CLI trades it for a token that lasts six hours.
Signing out
phaser-ae logout, or revoke its token in your account on phaser.io.

The skill

What setup writes.

The file
phaser-ae/SKILL.md, in the folder each coding agent reads its skills from: ~/.claude/skills for Claude Code, ~/.cursor/skills for Cursor, and so on for all 76. Codex's copy has agents/openai.yaml beside it, for how the ChatGPT app shows it.
What it does
Tells the agent what Phaser AE is, how to get Node.js, how to start a game in a folder of its own, and to follow that folder's brief from there. It's for Phaser AE alone: a request for the open-source Phaser library is left to the agent as before.
Which agents
Every one it finds on the computer, by its app, its command or its settings folder. Agents that read the same folder share one copy.
Kept up to date
build, blank and login write it too, for an agent whose copy is missing or from an older CLI. A SKILL.md the CLI didn't write is left alone.
Taking it out
npx -y @phaser-ae/cli setup --removeremoves only the copies the CLI wrote

A game's folder

Everything in one place.

my-game/
  CLAUDE.md, AGENTS.md   the brief: Claude Code reads CLAUDE.md, every other agent AGENTS.md
  package.json           the folder's commands, as npm scripts
  .phaser/build.json     the game's build on phaser.io: its design, its id, the site
  .claude/               the folder's commands allowed in Claude Code, and the game in the Claude app's browser pane
  design/                the game design document, its pictures and sounds, your playtest notes
  game/                  the game's code, yours to read and change; its packs in game/node_modules/@phaser-ae
  phaser/                Phaser AE: the engine, its tools, and the folder's own copy of the CLI

The brief comes from phaser.io, so it keeps up with the engine. The folder can be moved or renamed: .phaser/build.json keeps it tied to the game.

Commands

Every command.

Your agent runs these: you only need setup. Outside a game's folder they're phaser-ae <command> (or npx -y @phaser-ae/cli <command>). Inside one, most are npm scripts, written here as the script with its arguments after --.

Your account

Anywhere.

CommandDoesOptions
phaser-ae setupSigns you in, and writes the Phaser AE skill for every coding agent on the computer.--remove takes the skill out
phaser-ae loginSigns in again through your browser. Any command that needs phaser.io signs in by itself.
phaser-ae whoamiWho you're signed in as.
phaser-ae logoutSigns out: the token is removed from this computer.
phaser-ae creditsYour credits, and the credit packs on sale.--buy opens the page to buy more

Your games

Anywhere.

CommandDoesOptions
phaser-ae gamesYour designs and games on phaser.io, and where to play them.
phaser-ae newOpens phaser.io to design a new game.
phaser-ae design <game>Opens a design on phaser.io.
phaser-ae build <game> [folder]Makes a folder to build a design in: the design, the engine, the packs it needs and the brief.--prototype draws its art in code
phaser-ae blank [name] [folder]A new game with no design, named or not; blank . makes it in this folder.--idea "…", --core 2d|3d|vector, --landscape

In a game's folder

As npm run -s <command>, or phaser-ae <command> where it says so.

CommandDoesOptions
buildThe gate: strict types, the game's rules, then the bundle, into dist/.
typecheckStrict types, on their own.
checkThe game's rules, on their own.
smokePlays the game like a careless player, and reports what broke.
play -- "<steps>"Plays it a step at a time in a real browser: keys, taps, screenshots, the game's state, cheats.start, stop, --touch
look -- --script "<steps>"Builds the game, plays the steps in one go and saves the screenshots.--seed <n>, --touch, --out <folder>
serveServes the game on localhost:4173, built again on every change.
bakeMakes the game's engine again from its manifest, after its packs change.
packs -- search <words>Finds expansion packs for what the game needs.
packs -- info <id>One pack: what it does, its options, its reference.
packs -- add <id> [<id>…]Downloads packs into the game and its manifest.
packs -- listThe packs in the game.
publish -- "<what changed>"Builds the game and puts it on phaser.io as its next version.
playtestOpens the latest version's playtest page.
changesThe notes sent from the playtest page.--wait waits for them to be sent
statusThe game on phaser.io at a glance, with its links.
gddThe game design document as it is now, into design/design.md.
pullThe design again, as it is on phaser.io now.
idea -- "<idea>"Puts the game's idea onto its design on phaser.io.--title "<name>" names it
toolsEvery tool on phaser.io, each linked to this game.-- <tool> --open opens one
tool -- <tool> "<prompt>"Asks one tool (logo, sprites, music, sfx, images, title…); what it shows is saved in design/shown/.--open opens it
crew -- "<request>"Asks phaser.io for art or sound for the game, follows the work and brings the files in. With no request: who is working on what.--follow, --answer "<reply>", --pull
upload -- <file…>Your own files into the game, each by a key in assets.json: pictures, sound, video, 3D models, fonts, text and data. Phaser Pro.--note "…", --key <key>, --resize, --list, --remove <key>
phaser-ae roomThe link to watch the game being built, live.--stop stops following the folder
phaser-ae updateThe latest engine and CLI in this folder.
phaser-ae doctorChecks this computer.--fix gets the browser games are played in (Chromium)

Options

For every command.

--site <url>
Talks to another phaser.io, such as a development server.
--help
Every command, with what it does.

Troubleshooting

When something's wrong.

Check the computer
phaser-ae doctor--fix gets the browser games are played in
Waiting for approval
A command that says it's waiting for you to approve Phaser AE: approve it in the browser tab it opened, then run the command again.
Codex
Codex needs to reach the network and write outside its folder, for the CLI's downloads and your sign-in: allow it when it asks, or give it full access.
Windows
If you installed Node.js while Claude Desktop was open, restart the app so it can find it.