CLI Reference
Command
Section titled “Command”npx create-xtarter-app@latest [project-name] [options]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
project-name |
No | Name for the new project. If omitted, you’ll be prompted. |
Options
Section titled “Options”| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
--template |
-t |
string | - | Template ID to use (skips prompt). See Templates |
--pm |
-p |
string | - | Package manager (pnpm, npm, bun, yarn) |
--no-git |
- | boolean | - | Skip git initialization |
--clean |
- | boolean | - | Remove CI/CD config files after scaffolding |
--force |
-f |
boolean | - | Overwrite existing target directory |
--ref |
- | string | - | Git ref (branch, tag, or commit SHA) to download |
--yes |
-y |
boolean | - | Use defaults for all prompts (defaults to next-chakra template when -t is omitted) |
--quiet |
- | boolean | - | Suppress banners, spinners, and decorative output |
--json |
- | boolean | - | Output scaffold result as JSON (also suppresses banners and spinners) |
--no-color |
- | boolean | - | Disable colorized output |
--help |
-h |
boolean | - | Show help text |
--version |
-v |
boolean | - | Show version |
Subcommands
Section titled “Subcommands”| Command | Description |
|---|---|
preview [template] |
Preview template details without scaffolding |
Package managers
Section titled “Package managers”| Manager | Command | Note |
|---|---|---|
pnpm |
(default) | Fast, disk-efficient |
npm |
- | Default Node.js |
bun |
- | Ultra-fast runtime |
yarn |
- | Classic choice |
Examples
Section titled “Examples”npm create xtarter-app@latestpnpm create xtarter-app@latestyarn create xtarter-appbun create xtarter-app@latestnpm create xtarter-app@latest -- my-app --yespnpm create xtarter-app@latest my-app --yesyarn create xtarter-app my-app --yesbun create xtarter-app@latest my-app --yesnpm create xtarter-app@latest -- . -t vite-tailwindpnpm create xtarter-app@latest . -t vite-tailwindyarn create xtarter-app . -t vite-tailwindbun create xtarter-app@latest . -t vite-tailwindnpm create xtarter-app@latest -- my-app --template vite-tailwindpnpm create xtarter-app@latest my-app --template vite-tailwindyarn create xtarter-app my-app --template vite-tailwindbun create xtarter-app@latest my-app --template vite-tailwindnpm create xtarter-app@latest -- my-app --pm bun --no-gitpnpm create xtarter-app@latest my-app --pm bun --no-gityarn create xtarter-app my-app --pm bun --no-gitbun create xtarter-app@latest my-app --pm bun --no-gitnpm create xtarter-app@latest -- my-app -t vite-tailwind --forcepnpm create xtarter-app@latest my-app -t vite-tailwind --forceyarn create xtarter-app my-app -t vite-tailwind --forcebun create xtarter-app@latest my-app -t vite-tailwind --forcenpm create xtarter-app@latest -- my-app --ref v1.0.0pnpm create xtarter-app@latest my-app --ref v1.0.0yarn create xtarter-app my-app --ref v1.0.0bun create xtarter-app@latest my-app --ref v1.0.0npm create xtarter-app@latest -- preview next-tailwindpnpm create xtarter-app@latest preview next-tailwindyarn create xtarter-app preview next-tailwindbun create xtarter-app@latest preview next-tailwindError handling
Section titled “Error handling”- Invalid template ID - prints all valid template IDs and exits
- Invalid package manager - prints valid options and exits
- Target directory exists - cancels with an error unless
--forceis used - Invalid project name - validation fails during prompt
- Download failure - retries up to 3 times, then exits with error
- Install failure - cleans up created directory (if scaffolded to a new path), then exits
- Partial scaffold - if any step after download fails, created directories are cleaned up automatically
Programmatic API
Section titled “Programmatic API”The package also exports a programmatic API for use in scripts and tooling:
import { downloadTemplateFiles, modifyPackageJson, installDependencies, initializeGit, isGitInstalled, cleanCIConfigs, getTemplateById, getTemplateChoices, TEMPLATES,} from 'create-xtarter-app'
// Download a templateawait downloadTemplateFiles({ template: getTemplateById('vite-tailwind')!, targetPath: './my-app',})
// Modify package.jsonawait modifyPackageJson({ projectPath: './my-app', projectName: 'my-app' })
// Install dependenciesawait installDependencies({ packageManager: 'pnpm', projectPath: './my-app' })
// Initialize gitif (isGitInstalled()) { await initializeGit({ projectPath: './my-app' })}See Templates for the full TemplateConfig type.