@d3x3/pf-cli
v0.6.0
Published
Playform CLI — create, validate, pack, and upload flappy game packs
Readme
Playform CLI (@d3x3/pf-cli)
Create, validate, pack, and upload Playform flappy game packs. Packs run on https://playform-0.web.app (Stumble or direct play URL).
Commands
playform init flappy <dir>
Create a new flappy pack from the default template in <dir>.
- <dir> — Directory to create (e.g.
my-game). Must not exist or must be empty. - Writes:
manifest.json,game.js,assets/(bird.png, bg.png, pipe.png, tap.wav, die.wav),README.md(project only; not packed).
Example:
playform init flappy my-gameplayform validate [dir]
Validate a pack directory. Same rules as the backend so you fail locally, not after upload.
- [dir] — Pack directory (default: current directory).
- Checks: manifest.json exists and is valid; required fields; template
flappy_v0; entry file exists; no path traversal; allowed extensions; total size ≤ limits; all referenced assets exist. - Success: prints
✅ Pack is valid.and exits 0. - Failure: prints errors and exits 1.
Examples:
playform validate my-game
cd my-game && playform validateplayform pack [dir] -o <zip>
Zip the pack for upload. Only manifest.json, entry file, and manifest-listed assets are included.
- [dir] — Pack directory (default: current directory).
- -o, --output <zip> — Output zip path (required).
- Excludes: README.md, .DS_Store, anything not in the manifest.
- Zip root = manifest.json, game.js, assets/ (no top-level folder).
Example:
playform pack my-game -o my-game.zipplayform upload <zip> --api <url>
Upload a pack zip to the Playform API.
- <zip> — Path to the zip file.
- --api <url> — API base URL (default:
https://playform-api-507636286767.us-central1.run.app). - Prints the returned gameId and the play URL:
https://playform-0.web.app/play/<gameId>.
Examples:
playform upload my-game.zip
playform upload my-game.zip --api https://playform-api-507636286767.us-central1.run.app
playform upload my-game.zip --api http://localhost:8080playform dev [dir]
Run the pack locally without uploading: starts a static server for the pack dir and opens the browser to the web app’s /play/url?manifest=... route.
- [dir] — Pack directory (default: current directory).
- --port <number> — Port for the pack static server (default: 3456).
- --web <url> — Web app URL to open (default: http://localhost:5173).
Requires: The web app must be running (e.g. cd apps/web && npm run dev) so the game runtime can load the pack.
Examples:
playform dev my-game
playform dev my-game --port 3457 --web http://localhost:5173Install
From repo:
cd packages/cli
npm install
npm run build
npm link
playform --helpFrom npm (when published):
npm i -g @d3x3/pf-cli
playform --versionFull workflow
playform init flappy my-game- Edit
manifest.json,game.js, and files inassets/ playform validate my-gameplayform pack my-game -o my-game.zipplayform upload my-game.zip --api <prod-url>- Play at https://playform-0.web.app (Stumble or
/play/<gameId>)
See docs/creator-quickstart.md for a copy/paste friendly guide and docs/PRIORITY5-TASKS.md for implementation details.
