create-next-app CLI Flags
Complete reference for every create-next-app command-line flag in Next.js 15, when to use each one, and copy-paste commands for common scenarios. Sourced from the bundled docs in next/dist/docs/01-app/03-api-reference/06-cli/create-next-app.md.
Recipe
Quick-reference recipe card — copy-paste ready.
# The "everything on" command — TypeScript, Tailwind, App Router,
# src/ directory, custom alias, explicit npm, Turbopack, non-interactive
npx create-next-app@latest my-app \
--typescript \
--tailwind \
--app \
--src-dir \
--import-alias "@/*" \
--use-npm \
--turbopackWhen to reach for this: Anytime you want a reproducible, non-interactive scaffolding command in a README, a bootstrap script, or a CI job.
Working Example
All flags (Next.js 15)
| Flag | Description | Default |
|---|---|---|
-h, --help | Show all available options | — |
-v, --version | Output the version number | — |
--no-* | Negate any default option (e.g. --no-ts, --no-tailwind) | — |
--ts, --typescript | Initialize as a TypeScript project | on |
--js, --javascript | Initialize as a JavaScript project | off |
--tailwind | Initialize with Tailwind CSS | on |
--react-compiler | Initialize with React Compiler enabled | off |
--eslint | Initialize with ESLint config | on (when no other linter chosen) |
--biome | Initialize with Biome config | off |
--no-linter | Skip linter configuration entirely | off |
--app | Initialize as an App Router project | on |
--api | Initialize a project with only route handlers | off |
--src-dir | Put code inside a src/ directory | off |
--turbopack | Force Turbopack in generated package.json | on |
--webpack | Force Webpack in generated package.json | off |
--import-alias <alias> | Configure the import alias | @/* |
--empty | Initialize an empty project (minimal files) | off |
--use-npm | Bootstrap with npm | — |
--use-pnpm | Bootstrap with pnpm | — |
--use-yarn | Bootstrap with Yarn | — |
--use-bun | Bootstrap with Bun | — |
-e, --example <name-or-url> | Bootstrap from an official example or public GitHub URL | — |
--example-path <path> | Path inside a monorepo example | — |
--reset-preferences | Reset any stored answers from previous runs | off |
--skip-install | Skip installing packages | off |
--disable-git | Do not run git init | off |
--agents-md | Include AGENTS.md and CLAUDE.md | on |
--yes | Use previous preferences or defaults for everything | off |
Scenario commands
# Minimal — TS and App Router, nothing else
npx create-next-app@latest my-app \
--typescript --app \
--no-tailwind --no-eslint --no-src-dir
# With Tailwind v4 (this cookbook's stack)
npx create-next-app@latest my-app \
--typescript --tailwind --app \
--import-alias "@/*"
# With a src/ directory (common in larger codebases)
npx create-next-app@latest my-app \
--typescript --tailwind --app --src-dir
# Yes to all current defaults, skip every prompt
npx create-next-app@latest my-app --yes
# Skip every prompt and install, useful for CI
npx create-next-app@latest my-app --yes --skip-install --disable-git
# Bootstrap from an official example
npx create-next-app@latest my-blog --example blog-starter
# Bootstrap from any public GitHub repo
npx create-next-app@latest my-app \
--example "https://github.com/vercel/next.js/tree/canary/examples/with-stripe-typescript"
# API-only project (route handlers, no app pages)
npx create-next-app@latest my-api --typescript --api
# React Compiler enabled from day one
npx create-next-app@latest my-app \
--typescript --tailwind --app --react-compilerDeep Dive
How It Works
create-next-app is a standalone scaffolder published to npm. When you run it through npx, pnpm create, yarn create, or bun create, the package manager downloads the package to a temporary cache and runs its bin entry. The CLI:
- Parses flags and merges them with any stored preferences under
~/.config/create-next-app/. - Prompts only for answers that were not provided on the command line.
- Picks a template — the default template,
--emptyfor a bare-bones one, or the repo pointed to by-e/--example. - Copies files into the target directory, rewriting package names.
- Runs the chosen package manager's install command unless
--skip-installis set. - Runs
git initand an initial commit unless--disable-gitis set. - Writes
AGENTS.mdandCLAUDE.mdunless--no-agents-mdis set.
Because stored preferences are respected, two developers running the same create-next-app command can get different scaffolds. --reset-preferences or passing every flag explicitly guarantees determinism.
Variations
- Interactive mode: omit every flag —
npx create-next-app@latest— and answer prompts one by one. Good for learners; bad for scripts. - Pin the CLI version:
npx create-next-app@15.0.0 my-app ...so your scaffold is reproducible months later. - Skip git:
--disable-git. Useful when scaffolding into an existing monorepo. - Skip install:
--skip-install. You can then editpackage.jsonbefore running the installer yourself. - Official example:
--example blog-starter. See theexamples/folder in thevercel/next.jsrepo for the full list. - GitHub URL example:
--example "https://github.com/owner/repo/tree/branch/path". Combine with--example-pathif the example lives deep inside a monorepo.
TypeScript Notes
The --typescript and --ts flags are aliases for the exact same behavior — they both write tsconfig.json with strict: true, moduleResolution: "bundler", the Next plugin registered, and @/* paths configured. Everything else is identical.
Compared to adding TypeScript manually later (npm install -D typescript @types/react @types/node, then running next dev), the flag saves one step: Next generates tsconfig.json automatically on first next dev anyway, but the flag also installs the dev dependencies and writes next-env.d.ts up front. For monorepos where you already control a shared tsconfig.base.json, skipping --typescript and wiring TS yourself is sometimes cleaner.
Gotchas
--tailwindvs--no-tailwind— there is no--no-ts-style symmetry for every flag. Most flags support--no-*, but the help text is the source of truth; always check withcreate-next-app --help.-emeans--example, not--eslint. The short flags are compressed and easy to mistype. Use long flags in scripts.-tsis not a short flag —--tsrequires two dashes. A single-dash-tswill be parsed as-t -sand error.- Defaults move between Next.js versions. Tailwind, ESLint, and Turbopack all became defaults relatively recently. If your README says
npx create-next-app@latest, the resulting scaffold will drift over time; pin to@15or pass every flag explicitly. --use-npmdoes not block other package managers. It selects npm as the installer for the scaffold step; you can stillpnpm installafterwards in the project and it will work (you will just have both lockfiles to clean up).- Interactive mode remembers previous answers. A second run in the same shell may silently pre-fill answers from the cache. Use
--reset-preferencesor--yesplus explicit flags for reproducibility. --yesfollows whatever the current defaults are. A CI job using--yeswill produce different output after a Next.js major release. Prefer explicit flags in CI.--exampledisables most other flags. When you bootstrap from an example, flags like--tailwindor--src-dirare ignored because the example already defines its own structure.
Alternatives
| Tool | Command | When to use |
|---|---|---|
| Manual setup | npm init -y && npm install next react react-dom | Full control, no template noise, you are comfortable writing app/layout.tsx by hand |
| Turborepo | npx create-turbo@latest | You want a monorepo with multiple apps (Next.js + packages) scaffolded together |
| T3 Stack | npx create-t3-app@latest | You want Next.js + Prisma + tRPC + NextAuth + Tailwind pre-wired |
| Vercel templates gallery | npx create-next-app@latest --example <template> | You want a production-shaped starter (commerce, blog, portfolio) |
FAQs
Quick review of this page — click to expand.
What is the difference between --ts and --typescript?
Nothing. They are aliases for the exact same flag and produce the same tsconfig.json, dependencies, and next-env.d.ts.
How do I opt out of a default flag?
Prefix it with --no-. For example, --no-tailwind, --no-eslint, --no-src-dir. Gotcha: not every flag supports negation; run create-next-app --help to confirm.
What does --yes do?
It skips every prompt and uses your stored preferences if they exist, otherwise the current defaults. Safe for first-time runs; risky in long-lived scripts because defaults drift.
Can I skip git init?
Yes — pass --disable-git. Useful when scaffolding into a directory that is already a git repo or a monorepo.
Can I skip npm install?
Yes — pass --skip-install. The CLI will still copy files and initialize git; you run the installer yourself afterwards.
How do I bootstrap from a GitHub example?
npx create-next-app@latest my-app --example "https://github.com/owner/repo/tree/branch/path/to/example". Works for any public GitHub repo.
What is --empty for?
It creates a minimal project with no demo content — no starter styles, no sample components — just the files you need for the router to boot.
Does --use-npm prevent me from using pnpm later?
No. It only controls which installer runs during scaffolding. You can switch package managers afterwards. Gotcha: delete the old lockfile first or you will end up with both package-lock.json and pnpm-lock.yaml.
Why did my scaffold look different today than last week?
You are running @latest and the defaults changed between Next.js versions. Pin the version: create-next-app@15.0.0. Gotcha: this happens silently, often after a Next.js minor release.
Is there a way to force Webpack instead of Turbopack?
Yes — --webpack writes the generated package.json so next dev and next build use Webpack.
Does --typescript differ from adding TS manually later?
Functionally, no. Both end up with the same tsconfig.json because Next generates it on first run either way. TS note: the flag additionally pre-installs typescript, @types/react, and @types/node so the first next dev does not pause to install them.
What does --react-compiler actually turn on?
It wires up the React Compiler (the memoization-at-build-time tool) in next.config.ts from the start. TS note: the compiler is orthogonal to TypeScript — it affects build output, not the type system.