Skip to main content

Getting started

create-pixi.js asks a few questions, then writes a small PixiJS project that runs as soon as its dependencies are installed.

Requirements​

  • Node.js 22.12 or newer (22.15 or newer for the webpack template). Check with node --version.
  • npm, yarn, pnpm or bun. npm comes with Node.js.

Create a project​

Run the create command for your package manager:

npm create pixi.js@latest

You don't need to install anything first. The package manager downloads create-pixi.js, runs it, and starts the prompts. Keep @latest in the npm command so npm doesn't reuse an older copy from its cache.

Answer the prompts​

PromptWhen it appears
Project nameWhen you didn't pass a folder. The folder to create, pixi-project by default.
Target directoryWhen the folder already has files in it. Cancel, remove the existing files, or keep them and write the template on top.
Package nameWhen the folder name isn't a valid npm package name, for example because it has capital letters or spaces.
Type of templateUnless you passed --template.
GameFor the Game type, when there's more than one game.
PlatformFor the Game type. Where the game runs, such as the web or Discord.
Multiplayer?For the Game type, when the game and the platform both have a multiplayer version.
TemplateFor the other types.
LanguageWhen the template comes in both TypeScript and JavaScript.

A folder that holds only a .git folder counts as empty. The template types are:

  • Game: A game starter for the platform of your choice, with GSAP, PixiJS UI, PixiJS Sound, PixiJS Filters and Spine. Then pick a platform (Web or Discord Activity) and whether it's multiplayer.
  • Bundler: A minimal PixiJS app wired up to the build tool of your choice. Then pick Vite, webpack, esbuild, or Import map.
  • Framework: PixiJS rendered inside a UI framework.
  • Extension: A library project for publishing your own PixiJS plugin.

Choosing a template compares them side by side.

Skip the prompts​

Pass a folder and --template to create a project without any questions:

npm create pixi.js@latest my-app -- --template bundler-vite

npm needs the extra --. Without it, npm reads --template as one of its own options instead of passing it to create-pixi.js. yarn, pnpm and bun pass it along as is.

Use . as the folder to create the project in the current folder:

npm create pixi.js@latest . -- --template bundler-vite

You still get the overwrite prompt if the folder isn't empty. The CLI reference lists every template id.

Run it​

When it finishes, the CLI prints the commands to run next:

cd my-app
npm install
npm run dev

dev starts a development server on http://localhost:8080. Every template except esbuild also opens it in your browser.

To make a production build:

npm run build

The build lints your code, type-checks it in TypeScript templates, and writes the result to dist/. Upload that folder to any static host. A few templates work differently: the import map template has no build step, the multiplayer and Discord game templates build a Node.js server as well, and the extension template builds a library.

Next​