Capítulo 431 de 456

create-next-app CLI

Core Idea

The easiest way to scaffold a new Next.js application, using the default template or any public GitHub example repo.

Key Concepts

  • Basic usage: npx create-next-app@latest [project-name] [options] (or pnpm create next-app, yarn create next-app, bun create next-app).
  • --yes: use previous preferences or defaults for all options (non-interactive).
  • --example [name] [github-url]: bootstrap from an official example or any public GitHub URL.
  • --agents-md: includes AGENTS.md and CLAUDE.md to guide coding agents (default).
  • Linter choice: ESLint (traditional, @next/eslint-plugin-next), Biome (fast, combines lint+format), or None.

Code Examples

npx create-next-app@latest
  • O que demonstra: comando básico interativo.
npx create-next-app@latest --example [example-name] [your-project-name]
  • O que demonstra: bootstrap a partir de um exemplo oficial do repositório Next.js.

Reference Tables

OptionsDescription
-h or --helpShow all available options
-v or --versionOutput the version number
--no-*Negate default options (e.g. --no-ts)
--ts or --typescriptInitialize as TypeScript project (default)
--js or --javascriptInitialize as JavaScript project
--tailwindInitialize with Tailwind CSS config (default)
--react-compilerInitialize with React Compiler enabled
--eslintInitialize with ESLint config
--biomeInitialize with Biome config
--no-linterSkip linter configuration
--appInitialize as App Router project
--apiInitialize a project with only route handlers
--src-dirInitialize inside a src/ directory
--turbopackForce enable Turbopack (default)
--webpackForce enable Webpack
--import-alias <alias>Specify import alias (default @/*)
--emptyInitialize an empty project
--use-npm/--use-pnpm/--use-yarn/--use-bunForce package manager
-e or --example [name] [github-url]Example to bootstrap with
--example-path <path>Path to the example within the repo
--reset-preferencesReset any stored preferences
--skip-installSkip installing packages
--disable-gitDisable git initialization
--agents-mdInclude AGENTS.md and CLAUDE.md (default)
--yesUse previous preferences/defaults for all options

Key Takeaways

  1. Prompts padrão recomendam TypeScript, ESLint, Tailwind CSS, App Router e AGENTS.md.
  2. Biome é alternativa moderna ao ESLint que combina lint+format numa ferramenta só.
  3. --example aceita tanto nome oficial quanto qualquer URL pública de repo GitHub.

Connects To

  • next CLI (ch432): próximo passo depois de criar o projeto.