Documentation Index
Fetch the complete documentation index at: https://mintlify.com/amanvarshney01/create-better-t-stack/llms.txt
Use this file to discover all available pages before exploring further.
Complete reference for all exported TypeScript types from create-better-t-stack.
Core Types
Input options for the create() function.
type CreateInput = {
projectName?: string;
template?: Template;
frontend?: Frontend[];
backend?: Backend;
runtime?: Runtime;
database?: Database;
orm?: ORM;
api?: API;
auth?: Auth;
payments?: Payments;
addons?: Addons[];
examples?: Examples[];
packageManager?: PackageManager;
install?: boolean;
git?: boolean;
dbSetup?: DatabaseSetup;
webDeploy?: WebDeploy;
serverDeploy?: ServerDeploy;
directoryConflict?: DirectoryConflict;
yes?: boolean;
yolo?: boolean;
disableAnalytics?: boolean;
manualDb?: boolean;
}
Source: ~/workspace/source/packages/types/src/types.ts:48
InitResult
Success result from create() function.
type InitResult = {
success: boolean;
projectConfig: ProjectConfig;
reproducibleCommand: string;
timeScaffolded: string;
elapsedTimeMs: number;
projectDirectory: string;
relativePath: string;
error?: string;
}
Source: ~/workspace/source/packages/types/src/types.ts:53
ProjectConfig
Complete project configuration.
type ProjectConfig = {
projectName: string;
projectDir: string;
relativePath: string;
database: Database;
orm: ORM;
backend: Backend;
runtime: Runtime;
frontend: Frontend[];
addons: Addons[];
examples: Examples[];
auth: Auth;
payments: Payments;
git: boolean;
packageManager: PackageManager;
install: boolean;
dbSetup: DatabaseSetup;
api: API;
webDeploy: WebDeploy;
serverDeploy: ServerDeploy;
}
Source: ~/workspace/source/packages/types/src/types.ts:51
AddResult
Result from add() function.
type AddResult = {
success: boolean;
addedAddons: Addons[];
projectDir: string;
error?: string;
}
Source: ~/workspace/source/apps/cli/src/helpers/core/add-handler.ts:29
Configuration Types
Database
Database provider options.
type Database =
| "sqlite"
| "postgres"
| "mysql"
| "mongo"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:30
ORM
ORM/database toolkit options.
type ORM =
| "drizzle"
| "prisma"
| "mongoose"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:31
Backend
Backend framework options.
type Backend =
| "hono"
| "express"
| "fastify"
| "elysia"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:32
Runtime
JavaScript runtime options.
type Runtime =
| "bun"
| "node"
Source: ~/workspace/source/packages/types/src/types.ts:33
Frontend
Frontend framework options.
type Frontend =
| "tanstack-router"
| "tanstack-start"
| "react-router"
| "next"
| "nuxt"
| "svelte"
| "solid"
| "native-bare"
| "native-uniwind"
| "native-unistyles"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:34
API
API layer options.
type API =
| "trpc"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:39
Auth
Authentication provider options.
type Auth =
| "better-auth"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:40
Payments
Payments provider options.
type Payments =
| "stripe"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:41
Addons
Available addon integrations.
type Addons =
| "biome"
| "playwright"
| "husky"
| "mcp"
| "alchemy"
| "pwa"
| "posthog"
Source: ~/workspace/source/packages/types/src/types.ts:35
Examples
Available example code templates.
type Examples =
| "todo"
| "crud"
| "form"
Source: ~/workspace/source/packages/types/src/types.ts:36
PackageManager
Package manager options.
type PackageManager =
| "bun"
| "npm"
| "pnpm"
| "yarn"
Source: ~/workspace/source/packages/types/src/types.ts:37
DatabaseSetup
Database setup mode options.
type DatabaseSetup =
| "auto"
| "manual"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:38
WebDeploy
Web deployment platform options.
type WebDeploy =
| "vercel"
| "netlify"
| "cloudflare"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:42
ServerDeploy
Server deployment platform options.
type ServerDeploy =
| "railway"
| "fly"
| "render"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:43
Template
Predefined template options.
type Template =
| "tanstack"
| "next"
| "nuxt"
| "svelte"
| "solid"
| "native"
| "api"
Source: ~/workspace/source/packages/types/src/types.ts:44
DirectoryConflict
Directory conflict resolution strategies.
type DirectoryConflict =
| "error" // Throw error if directory exists
| "overwrite" // Delete and recreate directory
| "merge" // Merge with existing files
| "increment" // Auto-increment name (my-app-1, my-app-2, ...)
Source: ~/workspace/source/packages/types/src/types.ts:45
Virtual Filesystem Types
VirtualFileTree
The complete virtual file tree structure.
type VirtualFileTree = {
root: VirtualDirectory;
fileCount: number;
directoryCount: number;
config: ProjectConfig;
}
Source: ~/workspace/source/packages/template-generator/src/types.ts:23
VirtualFile
A file node in the virtual tree.
type VirtualFile = {
type: "file";
path: string; // "src/index.ts"
name: string; // "index.ts"
content: string; // File contents
extension: string; // "ts"
sourcePath?: string; // Original template path
}
Source: ~/workspace/source/packages/template-generator/src/types.ts:5
VirtualDirectory
A directory node in the virtual tree.
type VirtualDirectory = {
type: "directory";
path: string; // "src/components"
name: string; // "components"
children: VirtualNode[];
}
Source: ~/workspace/source/packages/template-generator/src/types.ts:14
VirtualNode
Union of file and directory nodes.
type VirtualNode = VirtualFile | VirtualDirectory
Source: ~/workspace/source/packages/template-generator/src/types.ts:21
GeneratorOptions
Options for the template generator.
type GeneratorOptions = {
config: ProjectConfig;
templateBasePath?: string;
templates?: Map<string, string>;
version?: string; // CLI version for bts.jsonc
}
Source: ~/workspace/source/packages/template-generator/src/types.ts:30
Error Types
See Error Handling for complete error type documentation.
type CreateError = UserCancelledError | CLIError | ProjectCreationError
Source: ~/workspace/source/apps/cli/src/index.ts:164
Result Type
The API uses the Result type from better-result:
type Result<T, E> = Ok<T> | Err<E>
interface Ok<T> {
isOk(): true;
isErr(): false;
value: T;
unwrap(): T;
unwrapOr(defaultValue: T): T;
match<U>(handlers: { ok: (value: T) => U; err: (error: E) => U }): U;
}
interface Err<E> {
isOk(): false;
isErr(): true;
error: E;
unwrap(): never;
unwrapOr<T>(defaultValue: T): T;
match<U>(handlers: { ok: (value: T) => U; err: (error: E) => U }): U;
}
Type Utilities
All fields in CreateInput are optional when passed to create():
create("my-app", options?: Partial<CreateInput>)
Frontend Subsets
Web-only frontends:
type WebFrontend =
| "tanstack-router"
| "react-router"
| "tanstack-start"
| "next"
| "nuxt"
| "svelte"
| "solid"
| "none"
Native-only frontends:
type NativeFrontend =
| "native-bare"
| "native-uniwind"
| "native-unistyles"
| "none"
Source: ~/workspace/source/packages/types/src/types.ts:55
Import Examples
Import Core Types
import type {
CreateInput,
InitResult,
ProjectConfig,
AddResult,
} from "create-better-t-stack";
Import Configuration Types
import type {
Database,
ORM,
Backend,
Runtime,
Frontend,
Addons,
PackageManager,
} from "create-better-t-stack";
Import Virtual FS Types
import type {
VirtualFileTree,
VirtualFile,
VirtualDirectory,
VirtualNode,
} from "create-better-t-stack";
Import Error Types
import {
UserCancelledError,
CLIError,
ProjectCreationError,
ValidationError,
type CreateError,
} from "create-better-t-stack";
Import Result Type
import { Result } from "create-better-t-stack";
// Or from better-result directly
import { Result } from "better-result";