Commands
Complete reference for all CLI commands
The Better-T-Stack CLI provides several commands to manage your TypeScript projects.
create (Default Command)Creates a new Better-T-Stack project.
create-better-t-stack [project-directory] [options]project-directory (optional): Name or path for your project directory--yes, -y: Use default configuration (skips prompts)--dry-run: Validate configuration and target directory without writing files--verbose: Show detailed result information as JSON--yolo: Bypass validations and compatibility checks--package-manager <pm>: npm, pnpm, bun--install / --no-install: Install dependencies after creation--open <target>: Open the project in an installed editor, IDE, or coding agent--git / --no-git: Initialize Git repository--frontend <types...>: Web and/or native frameworks (see Options)--backend <framework>: hono, express, fastify, elysia, convex, self, none--runtime <runtime>: bun, node, workers (none only with --backend convex, --backend none, or --backend self)--database <type>: none, sqlite, postgres, mysql, mongodb--orm <type>: none, drizzle, prisma, mongoose--api <type>: none, trpc, orpc--auth <provider>: better-auth, clerk, none (see Options)--payments <provider>: polar, none--db-setup <setup>: none, turso, d1, neon, supabase, prisma-postgres, planetscale, mongodb-atlas, docker--examples <types...>: none, todo, ai--web-deploy <setup>: none, cloudflare--server-deploy <setup>: none, cloudflare--template <type>: none, mern, pern, t3, uniwind--directory-conflict <strategy>: merge, overwrite, increment, error--render-title / --no-render-title: Show/hide ASCII art title--disable-analytics / --no-disable-analytics: Control analytics collection--manual-db: Skip automatic database setup promptsSee the full reference in Options.
For JSON-first automation and agent usage, see Agent Workflows.
# Default setup with prompts
create-better-t-stack
# Quick setup with defaults
create-better-t-stack --yes
# Specific configuration
create-better-t-stack --database postgres --backend hono --frontend tanstack-router
# Validate without writing files
create-better-t-stack my-app --yes --dry-runaddAdds addons or scaffolds a workspace package in an existing Better-T-Stack project.
create-better-t-stack add [options]--addons <types...>: Addons to add (see Addons)--package <name>: Scaffold packages/<name> with a package manifest, shared TypeScript config, and src/index.ts--project-dir <path>: Project directory (defaults to current directory)--install [boolean]: Install dependencies after adding (defaults to false)--package-manager <pm>: Package manager to use (npm, pnpm, bun)--dry-run: Preview the changes without writing files--disable-analytics: Skip the anonymous failure event for this run (see Analytics)# Add addons interactively
create-better-t-stack add
# Add specific addons
create-better-t-stack add --addons pwa tauri --install
# Add addons in a specific project directory
create-better-t-stack add --project-dir ./my-app --addons mcp skills
# Scaffold @my-app/shared in packages/shared
create-better-t-stack add --package sharedcreate-jsonCreate a project from a raw JSON payload.
create-better-t-stack create-json --json '{"projectName":"my-app","yes":true,"dryRun":true}'Use this when you want a single machine-readable input object instead of many flags.
add-jsonAdd addons from a raw JSON payload.
create-better-t-stack add-json --json '{"projectDir":"./my-app","addons":["wxt"],"addonOptions":{"wxt":{"template":"react"}}}'schemaPrint runtime CLI and input schemas as JSON.
create-better-t-stack schema --name all
create-better-t-stack schema --name createInput
create-better-t-stack schema --name addonOptions
create-better-t-stack schema --name dbSetupOptionsThis is the best way for scripts and agents to discover the current input contract at runtime.
mcpStart the Better-T-Stack MCP server over stdio. It is launched by an MCP client (Claude Code, Codex, Cursor, opencode, and others), not run directly.
create-better-t-stack mcpIt exposes tools for planning and creating projects (bts_plan_project, bts_create_project) and managing addons (bts_plan_addons, bts_add_addons), plus schema and guidance helpers. See Agent Workflows for setup and the full tool list.
sponsorsDisplays Better-T-Stack sponsors.
create-better-t-stack sponsorsShows a list of project sponsors and supporters.
docsOpens the Better-T-Stack documentation in your default browser.
create-better-t-stack docsOpens https://www.better-t-stack.dev/docs in your browser.
builderOpens the web-based stack builder in your default browser.
create-better-t-stack builderOpens https://www.better-t-stack.dev/new where you can configure your stack visually.
historyShows project creation history stored on your local machine.
create-better-t-stack history [options]--limit <number>: Number of entries to show (default: 10)--json: Output history as JSON--clear: Clear all history entries# Show latest entries
create-better-t-stack history
# Show 5 entries
create-better-t-stack history --limit 5
# JSON output
create-better-t-stack history --json
# Clear history
create-better-t-stack history --clearThese options work with any command:
--help, -h: Display help information--version, -V: Display CLI versioncreate-better-t-stack \
--database postgres \
--orm drizzle \
--backend hono \
--frontend tanstack-router \
--auth better-auth \
--addons pwa biomecreate-better-t-stack api-server \
--frontend none \
--backend hono \
--database postgres \
--orm drizzle \
--api trpccd my-existing-project
create-better-t-stack add --addons tauri starlight --installcreate-better-t-stack history --limit 20For advanced use cases, automation, or integration with other tools, you can use the Programmatic API to create projects from Node.js code:
import { create } from "create-better-t-stack";
const result = await create("my-app", {
frontend: ["tanstack-router"],
backend: "hono",
database: "sqlite",
orm: "drizzle",
});
result.match({
ok: (data) => console.log(`Project created at: ${data.projectDirectory}`),
err: (error) => console.error(`Failed: ${error.message}`),
});This is useful for:
See the Programmatic API documentation for complete examples and API reference.