$npx -y skills add pixijs/pixijs-skills --skill pixijs-createUse this skill when scaffolding a new PixiJS v8 project with the create-pixi CLI or adding PixiJS to an existing project. Covers npm/yarn/pnpm/bun create commands, interactive vs non-interactive flows, bundler vs creation template categories, available template presets (bundler-v
| 1 | `create pixi.js` is the official CLI for scaffolding a new PixiJS v8 project. Run it with any package manager (`npm`, `yarn`, `pnpm`, `bun`) and pick a template from the interactive menu, or pass `--template` to skip prompts. It writes a self-contained project folder; you then `cd` in, install dependencies, and run the dev script. |
| 2 | |
| 3 | ## Quick Start |
| 4 | |
| 5 | Scaffold a new project with interactive prompts: |
| 6 | |
| 7 | ```bash |
| 8 | npm create pixi.js@latest |
| 9 | ``` |
| 10 | |
| 11 | Or skip prompts by passing a project name and template: |
| 12 | |
| 13 | ```bash |
| 14 | npm create pixi.js@latest my-game -- --template bundler-vite |
| 15 | ``` |
| 16 | |
| 17 | Then: |
| 18 | |
| 19 | ```bash |
| 20 | cd my-game |
| 21 | npm install |
| 22 | npm run dev |
| 23 | ``` |
| 24 | |
| 25 | Requires Node.js 18+ or 20+. Some templates (notably `creation-web` and `framework-react`) may require a newer Node version; the package manager will warn if so. |
| 26 | |
| 27 | ### Adding PixiJS to an existing project |
| 28 | |
| 29 | If you already have a bundler, framework, or project set up, skip the CLI and install the package directly: |
| 30 | |
| 31 | ```bash |
| 32 | npm install pixi.js |
| 33 | ``` |
| 34 | |
| 35 | Then import from `pixi.js` and construct an `Application` as shown in `pixijs-application`. The CLI templates are a convenience for new projects; they don't add anything to the library that `npm install pixi.js` can't give you. |
| 36 | |
| 37 | **Related skills:** `pixijs-application` (how the scaffolded `new Application()` + `app.init()` entry point works), `pixijs-core-concepts` (renderers and the render loop), `pixijs-scene-core-concepts` (scene graph fundamentals for the first things you'll add to the stage), `pixijs-assets` (loading textures, fonts, and bundles the template expects you to drop into `public/` or `src/assets/`). |
| 38 | |
| 39 | ## Core Patterns |
| 40 | |
| 41 | ### Choose a package manager |
| 42 | |
| 43 | The command is the same shape for every package manager: |
| 44 | |
| 45 | ```bash |
| 46 | npm create pixi.js@latest |
| 47 | yarn create pixi.js |
| 48 | pnpm create pixi.js |
| 49 | bun create pixi.js |
| 50 | ``` |
| 51 | |
| 52 | Under npm 7+ you must pass a `--` before CLI flags so npm doesn't consume them: |
| 53 | |
| 54 | ```bash |
| 55 | npm create pixi.js@latest my-game -- --template bundler-vite |
| 56 | ``` |
| 57 | |
| 58 | Yarn, pnpm, and bun don't need the extra separator: |
| 59 | |
| 60 | ```bash |
| 61 | yarn create pixi.js my-game --template bundler-vite |
| 62 | pnpm create pixi.js my-game --template bundler-vite |
| 63 | bun create pixi.js my-game --template bundler-vite |
| 64 | ``` |
| 65 | |
| 66 | Use `.` as the project name to scaffold into the current directory. |
| 67 | |
| 68 | ### Interactive flow |
| 69 | |
| 70 | Running with no arguments walks through prompts: |
| 71 | |
| 72 | 1. Project name (defaults to `pixi-project`). |
| 73 | 2. Framework / template category. |
| 74 | 3. Variant (TypeScript vs JavaScript where applicable). |
| 75 | 4. Whether to install dependencies immediately (some runners). |
| 76 | |
| 77 | At the end, the CLI prints the `cd` + install + dev commands for the manager you invoked it with. |
| 78 | |
| 79 | ### Non-interactive flow |
| 80 | |
| 81 | Pass a project name and `--template` to skip all prompts. This is the form you want for scripts, CI, and quickstart docs: |
| 82 | |
| 83 | ```bash |
| 84 | npm create pixi.js@latest my-game -- --template bundler-vite |
| 85 | ``` |
| 86 | |
| 87 | ### Available template presets |
| 88 | |
| 89 | Templates fall into two categories: |
| 90 | |
| 91 | - **Bundler templates** (`bundler-*`): generic PixiJS setup wired up with your bundler of choice. Use one of these when you want to pick your own structure. |
| 92 | - **Creation templates** (`creation-*`): platform-tailored starters with extras already wired in (AssetPack, sound, UI, scene routing). Use one of these when you want batteries included. |
| 93 | - **Framework templates** (`framework-*`): PixiJS embedded inside a host framework like React. |
| 94 | - **Extension templates** (`extension-*`): scaffolding for building a reusable PixiJS package. |
| 95 | |
| 96 | For most new projects, `bundler-vite` is the recommended starting point. |
| 97 | |
| 98 | | Template | What you get | |
| 99 | | -------------------- | ------------------------------------------------------------------------------------------------------------ | |
| 100 | | `bundler-vite` | Vite + TypeScript PixiJS project. The default first-stop template. | |
| 101 | | `bundler-vite-js` | Vite + plain JavaScript. | |
| 102 | | `bundler-webpack` | Webpack + TypeScript. | |