Jump to content

Installation

To scaffold an app using create-t3-app, run any of the following commands and answer the command prompt questions:

npm

npm create t3-app@latest

yarn

yarn create t3-app

pnpm

pnpm create t3-app@latest

bun

bun create t3-app@latest

After your app has been scaffolded, check out the first steps to get started on your new application.

Advanced usage

Option/FlagDescription
[dir]Include a directory argument with a name for the project
--noGitExplicitly tell the CLI to not initialize a new git repo in the project
-y, --defaultBypass the CLI and bootstrap a new t3-app with all options selected
--noInstallGenerate project without installing dependencies
-i, --import-aliasSet a custom import alias (default: ~/)

Experimental usage

For our CI, we have some experimental flags that allow you to scaffold any app without any prompts. If this use case applies to you, you can use these flags. Please note that these flags are experimental and may change in the future without following semver versioning.

FlagDescription
--CILet the CLI know you’re in CI mode
--tailwindInclude Tailwind CSS in the project
--trpcInclude tRPC in the project
--nextAuthInclude NextAuth.js in the project
--betterAuthInclude BetterAuth in the project
--prismaInclude Prisma in the project
--drizzleInclude Drizzle in the project
--dbProvider [provider]Choose a database provider for the project
--appRouterUse Next.js App Router in the project
--eslintInclude ESLint and Prettier in the project
--biomeInclude Biome for linting and formatting
⚠️

If you don’t provide the CI flag, the rest of these flags have no effect.

You don’t need to explicitly opt-out of the packages you don’t want. However, if you prefer to be explicit, you can pass false, e.g. --nextAuth false.

The --dbProvider flag accepts one of the following values: mysql, postgres, planetscale, sqlite. If not provided, the default is sqlite.

The following combinations are incompatible and will cause the CLI to exit:

  • --prisma + --drizzle
  • --eslint + --biome
  • --nextAuth + --betterAuth

Defaults

When using --CI, any flag not explicitly provided will default to not included. For example, if you don’t pass --tailwind, Tailwind CSS will not be installed. The only defaults that apply are:

  • --dbProvider defaults to sqlite
  • --import-alias defaults to ~/
  • Git is initialized unless --noGit is passed
  • Dependencies are installed unless --noInstall is passed

Examples

The following would scaffold a T3 App with tRPC and Tailwind CSS.

pnpm dlx create-t3-app@latest --CI --trpc --tailwind

The following would scaffold a T3 App with NextAuth.js, Tailwind CSS, Drizzle, and PostgreSQL.

pnpm dlx create-t3-app@latest --CI --nextAuth --tailwind --drizzle --dbProvider postgres

The following would scaffold a T3 App with Tailwind CSS, App Router, ESLint/Prettier, and a custom import alias.

pnpm dlx create-t3-app@latest --CI --tailwind --appRouter --eslint --import-alias "@/"