CLI Reference
All commands and options for create-turbo-stack
Global flags
| Flag | Description |
|---|---|
--verbose | Print stack traces and detailed errors on failure |
-V, --version | CLI version |
-h, --help | Help for any command |
Most write-capable commands also accept --dry-run to preview the diff without touching disk.
create (default)
Scaffold a new project.
npx create-turbo-stack [project-name] [--preset <url>] [--yes] [--no-install] [--dry-run]| Option | Description |
|---|---|
--preset <url> | Use a preset URL or file path |
--yes | Accept all defaults (non-interactive) |
--no-install | Skip dependency install |
--dry-run | Print the file tree; write nothing |
A preset's registryPackages are materialized via add after scaffolding.
npx create-turbo-stack my-app
npx create-turbo-stack my-app --preset https://create-turbo-stack.dev/s/saas-starter.jsoninit
Adopt an existing Turborepo by analyzing it and persisting .turbo-stack.json.
npx create-turbo-stack init [path] [--force]| Option | Description |
|---|---|
--force | Overwrite an existing .turbo-stack.json |
After init, the rest of the toolchain (add, remove, switch, upgrade) becomes available.
add
Add an app, package, integration, npm dependency, or a registry package by name (shadcn-style — see Registry Packages).
npx create-turbo-stack add <type|name> [name] [--dry-run]| Type | Description |
|---|---|
app [name] | New workspace app |
package [name] | New workspace package |
integration [category] | Set / change a provider in a category |
dependency <pkg> | Catalog-aware npm dep add (use --to=<workspace>) |
<name> / @ns/<name> | A registry package — fetched, verified, copied into packages/<name> |
app / package / integration prompt when run bare; pass the name (and flags
below) to run non-interactively (CI, agents):
| Flag | For | Description |
|---|---|---|
--type <t> | app / package | App type or package type |
--port <n> --i18n --consumes <a,b> | app | Port, i18n, consumed packages |
--css --exports <a,b> | package | Produces CSS; export subpaths |
--value <provider> | integration | The provider (e.g. posthog) |
--app <name> | integration / package / registry | Wire the package into this app's deps |
--registry <url|path> -y, --yes | registry | Source + skip confirm |
npx create-turbo-stack add app admin --type nextjs --port 3001
npx create-turbo-stack add package billing --type utils --app web
npx create-turbo-stack add integration analytics --value posthog --app web
npx create-turbo-stack add security # registry package
npx create-turbo-stack add @acme/feature-flags -y # private registry
npx create-turbo-stack add dependency lodash --to=apps/webremove
Remove an app, package, or integration. Stale files are deleted, empty directories are pruned, .turbo-stack.json is rewritten.
npx create-turbo-stack remove <type> [name] [--dry-run]| Type | What gets removed |
|---|---|
app <name> | apps/<name>/, app entry, deps that other apps no longer need |
package <name> | packages/<name>/, every app's consumes reference |
integration <category> | Provider files for that category, env vars, catalog entries |
switch
Atomic provider swap — old files deleted, new files written, in one transaction.
npx create-turbo-stack switch <category> [value] [--dry-run]Categories: db | auth | api | analytics | errorTracking | email | rateLimit | ai.
npx create-turbo-stack switch db prisma # was drizzle, becomes prisma
npx create-turbo-stack switch email nodemailer # was resend, becomes nodemailerupgrade
Migrate the project's preset to the current schema version. Walks the registered migration chain, validates the result, then re-applies the resolved file tree.
npx create-turbo-stack upgrade [--dry-run]Idempotent. On a project already at the current version, it reports "nothing to do" and exits.
reconcile
Report how the project on disk diverges from .turbo-stack.json — packages/apps
recorded in state but missing on disk, or on disk but untracked, plus expected
files that are absent. Read-only (writes nothing); drift happens via manual edits,
deletions, failed applies, or external tooling. Run it when add/remove/switch
seem to produce wrong diffs.
npx create-turbo-stack reconcile [--json]info
One-screen summary of the project's stack — schema version, basics, integrations, app/package counts. Read-only; safe in CI.
npx create-turbo-stack info [--json]list
Every app type and integration provider currently registered (built-in plus plugins loaded from create-turbo-stack.json).
npx create-turbo-stack list [--json]doctor
Environment + project sanity checks: Node version, package manager binaries, .turbo-stack.json validity, missing workspace directories, schema version drift. Exits non-zero on any fail-level finding — wire it into CI.
npx create-turbo-stack doctor [--json]analyze
Reverse-engineer an existing Turborepo into a preset JSON without persisting state. Use init if you want to write .turbo-stack.json instead.
npx create-turbo-stack analyze [path] [--json] [--open-builder] [--diff <file>]| Option | Description |
|---|---|
--json | Emit raw preset JSON to stdout |
--open-builder | Open the analyzed preset in the web builder |
--diff <file> | Compare with an existing preset file |
preset
Save or validate a preset JSON.
npx create-turbo-stack preset save [file]
npx create-turbo-stack preset validate <file>mcp
Start the Model Context Protocol server over stdio. Pin the project root with TURBO_STACK_ROOT=/path/to/project when launching from a client (Claude Desktop, Cursor) — otherwise the server uses the client's cwd, which is rarely your project.
TURBO_STACK_ROOT=/path/to/project npx create-turbo-stack mcpTools are prefixed with turbostack_ to avoid global namespace collisions on the client side.
Generated files at a glance
| Location | Notable files |
|---|---|
| Root | package.json (catalog), turbo.json, biome.json, .gitignore, .npmrc, .env.example, README.md, vitest.config.ts, .husky/pre-commit, .github/workflows/ci.yml, docker-compose.yml (if DB) |
| Per Next.js app | package.json, tsconfig.json, next.config.ts, vercel.json, src/app/{layout,page,error,not-found,loading}.tsx, src/app/{robots,sitemap,manifest}.ts, src/app/globals.css, instrumentation.ts (if Sentry), components.json + src/lib/utils.ts (if shadcn), src/i18n/{routing,request}.ts + messages/en.json + src/middleware.ts (if i18n) |
| Per package | package.json (exports map + catalog:), tsconfig.json, src/index.ts |
| State | .turbo-stack.json — preset + catalog + cssSourceMap + autoPackages + cliVersion + generatedAt, plus an optional config block (registries/policy/plugins) and registry provenance on add-ed packages |