English | 简体中文
Create a production-ready TanStarter app from the template and deploy it to Cloudflare Workers in about 10 minutes.
export CLOUDFLARE_ACCOUNT_ID="..."
export CLOUDFLARE_API_TOKEN="..."
npx tanstarter-cli@latest createTanStarter CLI will ask for the project name and resource names before creating anything.
Run without installing:
npx tanstarter-cli@latest createOr install globally:
npm install -g tanstarter-cliThen run:
tanstarter createtanstarter create [options]
tanstarter create <project-name> --resume
tanstarter delete <project-name> [options]Options:
--domain <domain>: configure a Cloudflare custom domain route.--repo <owner/name>: create this GitHub repository. If omitted, TanStarter CLI defaults to the current GitHub CLI login and project name, for exampleopen-fox/my-app.--resume: continue a failed setup from.tanstarter/state.json.-h, --help: show help.-v, --version: show version.
Example:
tanstarter create --domain app.example.com --repo mkfasthq/my-appIf a run fails after the project directory is created, fix the issue and run:
tanstarter create my-app --resumeTo delete the Cloudflare and GitHub resources created by the CLI, run:
tanstarter delete my-app- Node.js 20 or later.
- A Cloudflare account with
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKENavailable in your shell environment. - A GitHub account authenticated with GitHub CLI.
The CLI checks for node, pnpm, git, gh, GitHub CLI auth, and Cloudflare credentials. If pnpm, git, or gh is missing, the CLI attempts to install it with the available system package manager before continuing.
The setup flow:
- Clones the TanStarter template.
- Installs dependencies with
pnpm install. - Creates Cloudflare D1, R2, and KV resources.
- Updates
wrangler.jsonc. - Writes
.envand.env.production. - Runs database migrations.
- Builds and deploys locally.
- Syncs Worker secrets.
- Creates a GitHub repository.
- Syncs GitHub Actions secrets.
- Commits and pushes to
main.
Environment variables from the template .env.example are copied from your shell into the generated .env and .env.production files when present. Generated Cloudflare, D1, KV, base URL, and auth secret values take precedence.
- Website: tanstarter.dev
- CLI documentation: docs.tanstarter.dev/docs/cli
- CLI video tutorial: youtu.be/HVwilCX6YSA
If you have questions, contact support@tanstarter.dev or join the Discord community.
MIT