Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

index.md

147 lines6.3 KB

TanStack CLI

Quick Reference

# Create TanStack Start app
npx @tanstack/cli create my-app

# With add-ons
npx @tanstack/cli create my-app --add-ons clerk,drizzle,tanstack-query

# Add to existing project
npx @tanstack/cli add clerk drizzle

# List available add-ons
npx @tanstack/cli create --list-add-ons

# Minimal one-route Start app
npx @tanstack/cli create my-app --blank -y

Monorepo Structure

cli/
├── packages/
│   ├── cli/           # @tanstack/cli - Main CLI
│   ├── create/        # @tanstack/create - Core engine + frameworks
│   │   └── src/frameworks/
│   │       ├── react/     # React framework + add-ons
│   │       └── solid/     # Solid framework + add-ons
└── cli-aliases/       # Deprecated wrappers (create-tsrouter-app, etc.)

Development

pnpm install && pnpm build    # Setup
pnpm dev                       # Watch mode

# Test from peer directory (not inside monorepo)
node ../cli/packages/cli/dist/index.js create my-app

Key Terminology

TermDefinitionCLI Flag
Add-onPlugin that extends apps (auth, DB, etc)--add-ons
TemplateReusable project template--template
FrameworkReact or Solid--framework
Build toolVite (default) or Rsbuild--build-tool

CLI Commands

CommandDescription
tanstack create [name]Create TanStack Start app
tanstack add [add-ons]Add to existing project
tanstack add-on init/compileCreate custom add-on
tanstack template init/compileCreate custom template
tanstack librariesList TanStack libraries
tanstack docFetch a docs page
tanstack search-docsSearch TanStack docs
tanstack ecosystemList ecosystem partners
tanstack pin-versionsPin TanStack packages

Create Options

FlagDescription
--add-ons <ids>Comma-separated add-on IDs
--framework <name>React or Solid
--build-tool <name>Vite (default) or Rsbuild
--toolchain <id>Toolchain (use --list-add-ons to see options)
--deployment <id>Deployment target (use --list-add-ons to see options)
--template <url-or-id>Use template URL/path or built-in ID
--blankMinimal project without starter UI or default tooling
--no-gitSkip git init
--no-installSkip npm install
-yAccept defaults
-f, --forceOverwrite existing

EJS Template Variables

VariableTypeDescription
projectNamestringProject name
typescriptbooleanAlways true (TanStack Start requires TS)
tailwindbooleanFalse for blank unless an add-on requires it
bundlerstringResolved bundler (vite or rsbuild)
blankbooleanTrue when using the blank project preset
fileRouterbooleanAlways true
addOnEnabledobject{ [id]: boolean }
addOnOptionobject{ [id]: options }
packageManagerstringnpm/pnpm/yarn/bun/deno
jsstringAlways ts
jsxstringAlways tsx

Testing Add-ons Locally

# Serve add-on
npx serve .add-on -l 9080

# Use in create
node packages/cli/dist/index.js create test --add-ons http://localhost:9080/info.json

Agent Introspection Commands

npx @tanstack/cli create --list-add-ons --json
npx @tanstack/cli create --addon-details drizzle --json
npx @tanstack/cli libraries --json
npx @tanstack/cli search-docs "server functions" --library start --json
npx @tanstack/cli ecosystem --category database --json

Key Files

FilePurpose
packages/cli/src/cli.tsCLI command definitions
packages/create/src/frameworks/Framework implementations
packages/create/src/app-*.tsApp creation logic
.cta.jsonGenerated project config

Intent Skills

This project uses TanStack Intent. Run npx @tanstack/intent install to set up skill-to-task mappings for your coding agent. Before working on a task, read the relevant SKILL.md file in packages/cli/skills/.

Skill mappings — when working in these areas, load the linked skill file into context.

skills:

  • task: "scaffold a new TanStack app with create command, framework, build tool, template, toolchain, deployment, or add-on flags" load: "packages/cli/skills/create-app-scaffold/SKILL.md"
  • task: "add add-ons to an existing project using tanstack add" load: "packages/cli/skills/add-addons-existing-app/SKILL.md"
  • task: "query docs, list add-ons, inspect add-on details, or fetch library metadata for agent context" load: "packages/cli/skills/query-docs-library-metadata/SKILL.md"
  • task: "choose ecosystem integrations like auth providers, ORMs, or deployment targets" load: "packages/cli/skills/choose-ecosystem-integrations/SKILL.md"
  • task: "author, compile, or dev-watch custom add-ons or templates" load: "packages/cli/skills/maintain-custom-addons-dev-watch/SKILL.md"