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

examples.md

77 lines1.2 KB

1---
2id: examples
3title: Examples
4---
5​
6## Basic Usage
7​
8```bash
9# TanStack Start app (default, with SSR)
10tanstack create my-app -y
11​
12# Router-only SPA (no SSR)
13tanstack create my-app --router-only -y
14​
15# Interactive mode to pick add-ons
16tanstack create my-app --interactive
17​
18# Visual builder
19tanstack create --ui
20```
21​
22## Using Add-ons
23​
24```bash
25# List available add-ons
26tanstack create --list-add-ons
27​
28# See add-on details (dependencies, conflicts, options)
29tanstack create --addon-details <id>
30​
31# Create with specific add-ons
32tanstack create my-app --add-ons <id1>,<id2>,<id3>
33​
34# Add to existing project
35tanstack add <id1> <id2>
36```
37​
38## Recipes
39​
40### Full-Stack App
41​
42```bash
43tanstack create my-app
44cd my-app
45cp .env.example .env
46# Edit .env with API keys
47pnpm dev
48```
49​
50## CI/CD
51​
52### GitHub Actions
53​
54```yaml
55name: Create Project
56on:
57 workflow_dispatch:
58 inputs:
59 name:
60 required: true
61jobs:
62 create:
63 runs-on: ubuntu-latest
64 steps:
65 - run: npx @tanstack/cli create ${{ inputs.name }} -y
66```
67​
68### Docker
69​
70```dockerfile
71FROM node:20-slim
72RUN npm install -g @tanstack/cli pnpm
73RUN tanstack create app -y
74WORKDIR /app
75RUN pnpm install && pnpm build
76CMD ["pnpm", "start"]
77```