CLI

Commands

Complete reference for all CLI commands

Overview

The Better-T-Stack CLI provides several commands to manage your TypeScript projects.

create (Default Command)

Creates a new Better-T-Stack project.

kubojs [project-directory] [options]

Parameters

  • project-directory (optional): Name or path for your project directory

Key Options

  • --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
  • --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>: 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 prompts

See the full reference in Options.

For JSON-first automation and agent usage, see Agent Workflows.

Examples

# Default setup with prompts
kubojs

# Quick setup with defaults
kubojs --yes

# Specific configuration
kubojs --database postgres --backend hono --frontend tanstack-router

# Validate without writing files
kubojs my-app --yes --dry-run

add

Adds addons to an existing Better-T-Stack project.

kubojs add [options]

Options

  • --addons <types...>: Addons to add (see Addons)
  • --project-dir <path>: Project directory (defaults to current directory)
  • --install / --no-install: Install dependencies after adding
  • --package-manager <pm>: Package manager to use (npm, pnpm, bun)

Examples

# Add addons interactively
kubojs add

# Add specific addons
kubojs add --addons pwa tauri --install

# Add addons in a specific project directory
kubojs add --project-dir ./my-app --addons mcp skills

create-json

Create a project from a raw JSON payload.

kubojs create-json --input '{"projectName":"my-app","yes":true,"dryRun":true}'

Use this when you want a single machine-readable input object instead of many flags.

add-json

Add addons from a raw JSON payload.

kubojs add-json --input '{"projectDir":"./my-app","addons":["wxt"],"addonOptions":{"wxt":{"template":"react"}}}'

schema

Print runtime CLI and input schemas as JSON.

kubojs schema --name all
kubojs schema --name createInput
kubojs schema --name addonOptions
kubojs schema --name dbSetupOptions

This is the best way for scripts and agents to discover the current input contract at runtime.

mcp

Start 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.

kubojs mcp

It 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.

sponsors

Displays Better-T-Stack sponsors.

kubojs sponsors

Shows a list of project sponsors and supporters.

docs

Opens the Better-T-Stack documentation in your default browser.

kubojs docs

Opens https://better-t-stack.dev/docs in your browser.

builder

Opens the web-based stack builder in your default browser.

kubojs builder

Opens https://better-t-stack.dev/new where you can configure your stack visually.

history

Shows project creation history stored on your local machine.

kubojs history [options]

Options

  • --limit <number>: Number of entries to show (default: 10)
  • --json: Output history as JSON
  • --clear: Clear all history entries

Examples

# Show latest entries
kubojs history

# Show 5 entries
kubojs history --limit 5

# JSON output
kubojs history --json

# Clear history
kubojs history --clear

Global Options

These options work with any command:

  • --help, -h: Display help information
  • --version, -V: Display CLI version

Command Examples

Create a Full-Stack App

kubojs \
  --database postgres \
  --orm drizzle \
  --backend hono \
  --frontend tanstack-router \
  --auth better-auth \
  --addons pwa biome

Create a Backend-Only Project

kubojs api-server \
  --frontend none \
  --backend hono \
  --database postgres \
  --orm drizzle \
  --api trpc

Add Features to Existing Project

cd my-existing-project
kubojs add --addons tauri starlight --install

Show Local History

kubojs history --limit 20

Programmatic Usage

For 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 "kubojs";

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:

  • Build tools and generators - Create projects from templates
  • CI/CD pipelines - Generate test projects automatically
  • Development workflows - Batch create related projects
  • Custom tooling - Integrate with your existing development setup

See the Programmatic API documentation for complete examples and API reference.

On this page