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 Templates Locally
44
45```bash
46# In your template directory
47npx serve .template -l 9080
48
49# Create app with local template
50node ../cli/packages/cli/dist/index.js create my-app --template http://localhost:9080/template.json
51```
52
53## Dev Mode
54
55Create a sandbox app, watch built-in framework templates/add-ons, and run the sandbox dev server:
56
57```bash
58rm -rf test-app && node packages/cli/dist/index.js dev \
59 test-app --framework React --add-ons shadcn
60```
61
62The legacy `create --dev-watch <path>` flow still works for direct watch path control.
63
64## Submitting Changes
65
661. Run tests: `pnpm test`
672. Run build: `pnpm build`
683. Create a PR with a clear description
69
70## Project Structure
71
72```
73packages/
74├── cli/ # @tanstack/cli - CLI commands
75├── create/ # @tanstack/create - Engine + frameworks
76```
77
78## Useful Scripts
79
80```bash
81pnpm build # Build all packages
82pnpm test # Run tests
83pnpm dev # Watch mode
84pnpm cleanNodeModules # Clean all node_modules
85```