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

examples.md

76 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​
19For visual setup, use `https://tanstack.com/builder`.
20​
21## Using Add-ons
22​
23```bash
24# List available add-ons
25tanstack create --list-add-ons
26​
27# See add-on details (dependencies, conflicts, options)
28tanstack create --addon-details <id>
29​
30# Create with specific add-ons
31tanstack create my-app --add-ons <id1>,<id2>,<id3>
32​
33# Add to existing project
34tanstack add <id1> <id2>
35```
36​
37## Recipes
38​
39### Full-Stack App
40​
41```bash
42tanstack create my-app
43cd my-app
44cp .env.example .env
45# Edit .env with API keys
46pnpm dev
47```
48​
49## CI/CD
50​
51### GitHub Actions
52​
53```yaml
54name: Create Project
55on:
56 workflow_dispatch:
57 inputs:
58 name:
59 required: true
60jobs:
61 create:
62 runs-on: ubuntu-latest
63 steps:
64 - run: npx @tanstack/cli create ${{ inputs.name }} -y
65```
66​
67### Docker
68​
69```dockerfile
70FROM node:20-slim
71RUN npm install -g @tanstack/cli pnpm
72RUN tanstack create app -y
73WORKDIR /app
74RUN pnpm install && pnpm build
75CMD ["pnpm", "start"]
76```