← Back to archive

Repo of the Day

TanStack/cli

Published: Mar 12, 2025

Open repository ↗

Create-tsrouter-app is drop-in replacement for create-react-app that builds TanStack Router based SPA applications

Summary

TanStack CLI is the npm-published command-line tool @tanstack/cli for scaffolding and managing TanStack Start and TanStack Router projects. It is written in TypeScript, distributed under the MIT license, and exposes JSON-formatted commands so its capabilities can be driven from scripts or by AI agents.

What it is useful for

  • Bootstrapping new full-stack React apps with TanStack Start (the default), or SPA-only projects with TanStack Router when SSR is not needed.
  • Wiring in common add-ons at creation time, such as Clerk (auth), Drizzle (database), and TanStack Query, or installing them into an existing project later.
  • Standardizing project generation across a team, since the CLI accepts flags like --blank -y to skip prompts and produce a minimal one-route app non-interactively, which is useful in CI and scripting.
  • Driving setup from automation or agents. The README describes a "CLI Introspection" mode that lists add-ons, returns per-add-on details, lists libraries, and searches docs as machine-readable JSON.

A documented caveat: the tool sends anonymous usage telemetry by default, including command usage, durations, and selected framework, package manager, and add-on ids. It is disabled automatically in CI and can be disabled with DO_NOT_TRACK=1 or TANSTACK_CLI_TELEMETRY_DISABLED=1, or via tanstack telemetry disable. Project names, file paths, env vars, and raw query contents are explicitly listed as never sent.

How engineers can use it

Start a new project with npx @tanstack/cli create my-app, or use npx @tanstack/cli create my-app --blank -y to skip interactive prompts, or npx @tanstack/cli create my-app --router-only for a router-only SPA. Pre-select add-ons during creation with --add-ons clerk,drizzle,tanstack-query, or add them to an existing project with npx @tanstack/cli add clerk drizzle.

For programmatic use, list add-ons with npx @tanstack/cli create --list-add-ons, fetch details with npx @tanstack/cli create --addon-details tanstack-query --json, list libraries with npx @tanstack/cli libraries --json, and search docs with npx @tanstack/cli search-docs "loaders" --library router --framework react --json. Manage telemetry with tanstack telemetry status, disable, or enable. The README points to the TanStack CLI reference for the full command surface, since exhaustive flag listings are not included here.