# Getting started

## Create a game

```bash [npm]
npm create debuff@latest my-game
```

```bash [pnpm]
pnpm create debuff my-game
```

```bash [yarn]
yarn create debuff my-game
```

```bash [bun]
bun create debuff my-game
```

```bash
cd my-game
npm install
npm run dev
```

Open the URL it prints. Press ` to show the dev overlay, which has a frame-time graph and live sliders for every tunable value. Drag it by its header if it covers your game (debuff 0.27 or later); double-click the mascot to put it back in the corner.

Type errors show in the overlay too as you save, while the game keeps running (`typecheck: true` in `debuff.config.ts`, on in the basic template). Before the next release, each error had its own card. Now repeats share one card, errors only in test files are labelled and muted, a known error such as TS5097 suggests its fix and each card has **copy for agent**.

## What you get

```text
my-game/
  assets/            source art, audio, data; only files you reference ship
  scenarios/         deterministic gameplay tests (JSON)
  src/main.ts        your game
  index.html
```

| Command | What it does |
| --- | --- |
| `npm run dev` | Dev server with hot reload |
| `npm run build` | Production build, plus a size report that fails if dev code leaks |
| `npm test` | Runs `scenarios/*.json` in a headless browser |

If something won't start, run `npx debuff doctor`. It checks Node, the debuff package versions, `node_modules`, `debuff.config.ts`, assets, saves, agent files and the browser scenarios use, and says how to fix each problem. It also advises `allowImportingTsExtensions` when a `tsconfig.json` without it would report TS5097 for a test importing a `.ts` path, which new templates already set. `--live` also starts the dev server and checks the game exposes its dev hooks.

New projects start as a git repository with one first commit (pass `--no-git` to skip), so every change shows as a diff you can review or undo. To move to a newer debuff later, run `npx debuff upgrade`: it updates every debuff package together, installs, and refreshes the project's agent skills. Both from 0.21.

From 0.32 that first commit credits debuff as co-author (a `Co-authored-by` trailer for the [debuffbot](https://github.com/debuffbot) account), and the scaffold says so when it does. Pass `--no-credit` to leave it out. Only the first commit carries it; later commits are yours alone. The branch is `main` unless you've set `init.defaultBranch`.

## Next

- [Core concepts](./concepts): the game, scenes, the fixed-step loop
- [Input](./input): actions across keyboard, pointer and gamepad
- [Tunable params](./params): values you and your tools can adjust live