TanStack CLI 应用创建管理工具

TanStack CLI 是一个用于创建和管理 TanStack Router 与 TanStack Start 应用的命令行工具,支持 Vite/Rsbuild 构建工具、插件扩展以及面向 Agent 的 CLI 自省能力,适用于 React 和 Solid 项目的快速初始化与工程化管理。

  • by TanStack
  • TypeScript
  • 本地部署
  • 1304 星标
  • 更新于
在 GitHub 查看 TanStack/cli

使用说明

Become a Sponsor!

TanStack CLI

Create and manage TanStack Router and Start applications.

npx @tanstack/cli create my-app

Features

  • TanStack Start - Full-stack SSR framework (default)
  • TanStack Router - Type-safe routing (--router-only for SPA)
  • Vite or Rsbuild - Choose the build tool for React and Solid projects
  • Add-ons - Auth, database, deployment, monitoring, and more
  • CLI Introspection - Agent-friendly discovery via JSON CLI output

Quick Start

# Create TanStack Start app (recommended)
npx @tanstack/cli create my-app

# Create a minimal one-route Start app without selection prompts
npx @tanstack/cli create my-app --blank -y

# Create Router-only SPA (no SSR)
npx @tanstack/cli create my-app --router-only

# Create with Rsbuild
npx @tanstack/cli create my-app --build-tool rsbuild -y

# With add-ons
npx @tanstack/cli create my-app --add-ons clerk,drizzle,tanstack-query

# Add to existing project
npx @tanstack/cli add clerk drizzle

# List available add-ons
npx @tanstack/cli create --list-add-ons

# Agent-friendly introspection
npx @tanstack/cli create --addon-details tanstack-query --json
npx @tanstack/cli libraries --json
npx @tanstack/cli search-docs "loaders" --library router --framework react --json

Documentation

Telemetry

TanStack CLI sends anonymous usage telemetry by default.

  • Sent: command usage, durations, selected framework/build tool/package manager/add-on ids, and coarse result metadata
  • Never sent: project names, file paths, target directories, raw search queries, raw template URLs/paths, add-on config values, env vars, or raw error messages
  • Disabled automatically in CI, or when DO_NOT_TRACK=1 or TANSTACK_CLI_TELEMETRY_DISABLED=1

Manage it with:

tanstack telemetry status
tanstack telemetry disable
tanstack telemetry enable

Get Involved

TanStack Ecosystem

More at TanStack.com