Open History to see the last commit
1# Contributing
2
3## Setup
4
5```bash
6gh repo clone TanStack/cli
7cd cli
8pnpm install
9pnpm build
10```
11
12## Development
13
14```bash
15pnpm dev # Build and watch all packages
16```
17
18### Testing the CLI
19
20Run from a **peer directory** (not inside the monorepo):
21
22```bash
23# Create an app
24node ../cli/packages/cli/dist/index.js create my-app
25
26# With specific package manager
27npm_config_user_agent=pnpm node ../cli/packages/cli/dist/index.js create my-app
28
29# With local add-on
30node ../cli/packages/cli/dist/index.js create my-app --add-ons http://localhost:9080/info.json
31```
32
33### Testing Add-ons Locally
34
35```bash
36# In your add-on directory
37npx serve .add-on -l 9080
38
39# Create app with local add-on
40node ../cli/packages/cli/dist/index.js create my-app --add-ons http://localhost:9080/info.json
41```
42
43### Testing Starters Locally
44
45```bash
46# In your starter directory
47npx serve .starter -l 9080
48
49# Create app with local starter
50node ../cli/packages/cli/dist/index.js create my-app --starter http://localhost:9080/starter.json
51```
52
53## Dev Watch Mode
54
55Watch framework files and auto-rebuild:
56
57```bash
58rm -rf test-app && node packages/cli/dist/index.js create \
59 --dev-watch ./packages/create/src/frameworks/react \
60 test-app --add-ons shadcn
61```
62
63## Developing Create UI
64
65The UI requires running three things:
66
67```bash
68# Terminal 1: Watch mode for packages
69pnpm dev
70
71# Terminal 2: API server (from empty directory)
72CTA_DISABLE_UI=true node ../cli/packages/cli/dist/index.js create --ui
73
74# Terminal 3: React dev server
75cd packages/create-ui && pnpm dev:ui
76```
77
78Navigate to `http://localhost:3000` to see the UI connected to the API at `http://localhost:8080`.
79
80## Submitting Changes
81
821. Run tests: `pnpm test`
832. Run build: `pnpm build`
843. Create a PR with a clear description
85
86## Project Structure
87
88```
89packages/
90├── cli/ # @tanstack/cli - CLI commands
91├── create/ # @tanstack/create - Engine + frameworks
92└── create-ui/ # @tanstack/create-ui - Visual builder
93```
94
95## Useful Scripts
96
97```bash
98pnpm build # Build all packages
99pnpm test # Run tests
100pnpm dev # Watch mode
101pnpm cleanNodeModules # Clean all node_modules
102```