Commands
Every npm script in the kit, and when to run it.
| Command | What it does | When |
|---|---|---|
npm run dev | Starts the development server at http://localhost:3000 | While building |
npm run build | Production build | Before deploying; after changing pages, routing or caching |
npm start | Runs the production build locally | To test a build |
npm run typecheck | Generates Next's route types, then checks TypeScript | Before committing |
npm run lint | ESLint | Before committing |
npm test | Vitest tests in tests/ | Before committing; after billing changes |
npm run db:generate | Creates a migration from changes to src/db/schema.ts | After editing the schema |
npm run db:migrate | Applies pending migrations to DATABASE_URL | After generating, and after pulling kit updates |
npm run setup | Interactive setup of database, payments, email, sign-in and deploy | First setup; switching to live; adding a plan or domain |
npm run make-admin -- <email> | Gives an existing account the admin role | Once, after signing up |
All checks at once
npm run typecheck && npm run lint && npm test && npm run buildThe kit's GitHub Actions workflow runs the same four on every push.
Useful extras
| Command | What it does |
|---|---|
npx drizzle-kit studio | Browse your database tables in the browser |
npx cloudflared tunnel --url http://localhost:3000 | Public URL for testing webhooks locally |
npx vercel env pull .env.production.local | Download Vercel's production variables (to compare with .env.local) |
npx vercel logs <url> | Stream your live site's logs |