create-playcanvas
v0.2.5
Published
Scaffold a PlayCanvas project
Maintainers
Readme
create-playcanvas
Spin up a ready-to-code PlayCanvas project in seconds.
npm create playcanvas@latestAlso works with other package managers:
pnpm create playcanvas
yarn create playcanvas
bun create playcanvasThe CLI will prompt you for:
- Project name - folder to create (defaults to
playcanvas-project) - Overwrite behavior - if the folder already exists
- Package name - used in
package.json - Framework & variant - pick from templates below
Non-interactive Usage
Skip the prompts when scripting or if you know what you want:
npm create playcanvas@latest my-game -- -t react-ts --overwrite| Flag | Shorthand | Description |
| ------------------- | --------- | -------------------------------------------------- |
| --template <name> | -t | Directly choose template variant (see list below) |
| --overwrite | | Remove existing files in target directory |
| --help | -h | Show help/usage information |
Templates
| Template | Description |
| ------------ | -------------------------------------- |
| vanilla-ts | Vanilla TypeScript + PlayCanvas Engine |
| react-ts | React + TypeScript + PlayCanvas React |
To add your own template, drop a folder in templates/<name> and update templates/index.js.
Development
Clone the repo, then:
npm install
npm run dev # stub build for local development
node index.js # test the CLI locallyOr use npm link to test as if installed globally:
npm link
create-playcanvasContributing
Bug reports, feature requests and PRs are welcome! Want to create a new template? Please file an issue first if you plan major changes.
- Fork / clone
- Create a branch:
git checkout -b feat/my-awesome-idea - Commit with conventional-commit messages
- Push and open a PR
License
MIT
