Open History to see the last commit
1# TanStack CLI
2
3## Quick Reference
4
5```bash
6# Create TanStack Start app
7npx @tanstack/cli create my-app
8
9# With add-ons
10npx @tanstack/cli create my-app --add-ons clerk,drizzle,tanstack-query
11
12# Add to existing project
13npx @tanstack/cli add clerk drizzle
14
15# List available add-ons
16npx @tanstack/cli create --list-add-ons
17
18# Minimal one-route Start app
19npx @tanstack/cli create my-app --blank -y
20```
21
22## Monorepo Structure
23
24```
25cli/
26├── packages/
27│ ├── cli/ # @tanstack/cli - Main CLI
28│ ├── create/ # @tanstack/create - Core engine + frameworks
29│ │ └── src/frameworks/
30│ │ ├── react/ # React framework + add-ons
31│ │ └── solid/ # Solid framework + add-ons
32└── cli-aliases/ # Deprecated wrappers (create-tsrouter-app, etc.)
33```
34
35## Development
36
37```bash
38pnpm install && pnpm build # Setup
39pnpm dev # Watch mode
40
41# Test from peer directory (not inside monorepo)
42node ../cli/packages/cli/dist/index.js create my-app
43```
44
45## Key Terminology
46
47| Term | Definition | CLI Flag |
48| --------- | ---------------------------------------- | ------------- |
49| Add-on | Plugin that extends apps (auth, DB, etc) | `--add-ons` |
50| Template | Reusable project template | `--template` |
51| Framework | React or Solid | `--framework` |
52| Build tool | Vite (default) or Rsbuild | `--build-tool` |
53
54## CLI Commands
55
56| Command | Description |
57| ------------------------------- | ------------------------- |
58| `tanstack create [name]` | Create TanStack Start app |
59| `tanstack add [add-ons]` | Add to existing project |
60| `tanstack add-on init/compile` | Create custom add-on |
61| `tanstack template init/compile` | Create custom template |
62| `tanstack libraries` | List TanStack libraries |
63| `tanstack doc` | Fetch a docs page |
64| `tanstack search-docs` | Search TanStack docs |
65| `tanstack ecosystem` | List ecosystem partners |
66| `tanstack pin-versions` | Pin TanStack packages |
67
68## Create Options
69
70| Flag | Description |
71| -------------------- | ------------------------------------------------------- |
72| `--add-ons <ids>` | Comma-separated add-on IDs |
73| `--framework <name>` | React or Solid |
74| `--build-tool <name>` | Vite (default) or Rsbuild |
75| `--toolchain <id>` | Toolchain (use `--list-add-ons` to see options) |
76| `--deployment <id>` | Deployment target (use `--list-add-ons` to see options) |
77| `--template <url-or-id>` | Use template URL/path or built-in ID |
78| `--blank` | Minimal project without starter UI or default tooling |
79| `--no-git` | Skip git init |
80| `--no-install` | Skip npm install |
81| `-y` | Accept defaults |
82| `-f, --force` | Overwrite existing |
83
84## EJS Template Variables
85
86| Variable | Type | Description |
87| ---------------- | ------- | ---------------------------------------- |
88| `projectName` | string | Project name |
89| `typescript` | boolean | Always true (TanStack Start requires TS) |
90| `tailwind` | boolean | False for blank unless an add-on requires it |
91| `bundler` | string | Resolved bundler (`vite` or `rsbuild`) |
92| `blank` | boolean | True when using the blank project preset |
93| `fileRouter` | boolean | Always true |
94| `addOnEnabled` | object | `{ [id]: boolean }` |
95| `addOnOption` | object | `{ [id]: options }` |
96| `packageManager` | string | npm/pnpm/yarn/bun/deno |
97| `js` | string | Always `ts` |
98| `jsx` | string | Always `tsx` |
99
100## Testing Add-ons Locally
101
102```bash
103# Serve add-on
104npx serve .add-on -l 9080
105
106# Use in create
107node packages/cli/dist/index.js create test --add-ons http://localhost:9080/info.json
108```
109
110## Agent Introspection Commands
111
112```bash
113npx @tanstack/cli create --list-add-ons --json
114npx @tanstack/cli create --addon-details drizzle --json
115npx @tanstack/cli libraries --json
116npx @tanstack/cli search-docs "server functions" --library start --json
117npx @tanstack/cli ecosystem --category database --json
118```
119
120## Key Files
121
122| File | Purpose |
123| --------------------------------- | ------------------------- |
124| `packages/cli/src/cli.ts` | CLI command definitions |
125| `packages/create/src/frameworks/` | Framework implementations |
126| `packages/create/src/app-*.ts` | App creation logic |
127| `.cta.json` | Generated project config |
128
129
130## Intent Skills
131
132This project uses [TanStack Intent](https://github.com/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/`.
133
134<!-- intent-skills:start -->
135# Skill mappings — when working in these areas, load the linked skill file into context.
136skills:
137 - task: "scaffold a new TanStack app with create command, framework, build tool, template, toolchain, deployment, or add-on flags"
138 load: "packages/cli/skills/create-app-scaffold/SKILL.md"
139 - task: "add add-ons to an existing project using tanstack add"
140 load: "packages/cli/skills/add-addons-existing-app/SKILL.md"
141 - task: "query docs, list add-ons, inspect add-on details, or fetch library metadata for agent context"
142 load: "packages/cli/skills/query-docs-library-metadata/SKILL.md"
143 - task: "choose ecosystem integrations like auth providers, ORMs, or deployment targets"
144 load: "packages/cli/skills/choose-ecosystem-integrations/SKILL.md"
145 - task: "author, compile, or dev-watch custom add-ons or templates"
146 load: "packages/cli/skills/maintain-custom-addons-dev-watch/SKILL.md"
147<!-- intent-skills:end -->