Skip to content

CLI Reference

npx create-xtarter-app@latest [project-name] [options]
ArgumentRequiredDescription
project-nameNoName for the new project. If omitted, you’ll be prompted.
OptionAliasTypeDefaultDescription
--template-tstringTemplate ID to use (skips prompt). See Templates
--preview-PbooleanPreview template details without scaffolding
--pm-pstringPackage manager (pnpm, npm, bun, yarn)
--no-gitbooleanSkip git initialization
--cleanbooleanRemove CI/CD config files after scaffolding
--yes-ybooleanUse defaults for all prompts
--help-hbooleanShow help text
--version-vbooleanShow version
ManagerCommandNote
pnpm(default)Fast, disk-efficient
npmDefault Node.js
bunUltra-fast runtime
yarnClassic choice
Terminal window
# Interactive — prompts for everything
pnpm create xtarter-app
# Quick start with defaults
pnpm create xtarter-app my-app --yes
# Pick a template
pnpm create xtarter-app my-app --template vite-tailwind
# Specific package manager, no git
pnpm create xtarter-app my-app --pm bun --no-git
# Preview a template
pnpm create xtarter-app --preview --template next-tailwind
  • 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 (won’t overwrite)
  • Invalid project name — validation fails during prompt
  • Download failure — retries up to 3 times, then exits with error
  • Install failure — exits with the command’s exit code

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 template
await downloadTemplateFiles({
template: getTemplateById('vite-tailwind')!,
targetPath: './my-app',
})
// Modify package.json
await modifyPackageJson({ projectPath: './my-app', projectName: 'my-app' })
// Install dependencies
await installDependencies({ packageManager: 'pnpm', projectPath: './my-app' })
// Initialize git
if (isGitInstalled()) {
await initializeGit({ projectPath: './my-app' })
}

See Templates for the full TemplateConfig type.