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="..."
# Optional: enable Waffo payments during setup
export WAFFO_MERCHANT_ID="MER_..."
export WAFFO_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----..."
npx tanstarter-cli@latest createTanStarter CLI will ask for the project name, resource names, and payment method before creating anything. When you pick Waffo, it also creates a Waffo store, the three template products, and the webhook automatically.
To keep the payment prompt but accept every other default (domain, D1/R2/KV names, GitHub repository, and final confirmation), pass --yes:
npx tanstarter-cli@latest create my-app --yesInstall the TanStarter creation skill for Codex, Claude Code, or another supported agent:
npx skills add MkFastHQ/tanstarter-cli --skill tanstarter-createRun without installing:
npx tanstarter-cli@latest createOr install globally:
npm install -g tanstarter-cliThen run:
tanstarter createtanstarter create [options]
tanstarter delete <project-name> [options]
tanstarter create <project-name> --resumeOptions:
--domain <domain>: configure a Cloudflare custom domain route.--payment <none|waffo>: payment method for the generated project. Withwaffo, the CLI uses the template's built-in monthly, yearly, and lifetime products, then creates the Waffo store, products, and webhook during setup.-y, --yes: accept default domain, resource names, GitHub repository, and final confirmation. It still asks for payment unless--paymentis set.--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.
- (Waffo only) Create a Test API Key in the Waffo dashboard (API & Development → API Keys). Use the
MER_...merchant ID asWAFFO_MERCHANT_IDand the private key value provided by Waffo asWAFFO_PRIVATE_KEY; the CLI passes that value through unchanged. The CLI always uses Waffo test mode and falls back to the deployedworkers.devURL when no custom domain is supplied.
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.
When running without a TTY, pass --payment waffo. No store/product fields or extra Waffo environment variables are required; the CLI uses the template's built-in pricing. --domain is optional:
npx tanstarter-cli@latest create my-app --payment waffoThe CLI creates a project-named store and three products matching the template: Pro Monthly at $9.90, Pro Yearly at $99.00, and Lifetime at $199.00. Their IDs are written to VITE_WAFFO_PRODUCT_PRO_MONTHLY, VITE_WAFFO_PRODUCT_PRO_YEARLY, and VITE_WAFFO_PRODUCT_LIFETIME, then the site is deployed, Worker secrets are synchronized, the public URL is verified, and https://<domain>/api/webhooks/waffo (or the deployed workers.dev equivalent) is registered. The deployed Worker keeps WAFFO_DEBUG=true, so the online site uses Waffo test payments.
The CLI always provisions Waffo in test mode. Live product publishing is outside this setup flow.
Waffo may still require merchant verification, business details, or payout setup in its dashboard.
The setup flow:
- Clones the TanStarter template and preserves its Git history.
- Installs dependencies with
pnpm install. - Verifies Cloudflare authentication.
- (Waffo only) Creates the Waffo store and three template products.
- Creates Cloudflare D1, R2, and KV resources.
- Updates
wrangler.jsoncand writes.env/.env.production. - Runs database migrations.
- Builds and deploys locally.
- Syncs Worker secrets.
- Verifies the public deployment URL.
- (Waffo only) Registers the webhook after the deployed route is reachable.
- Creates a GitHub repository.
- Syncs GitHub Actions secrets.
- Commits and pushes to
main.
The generated repository uses origin for your new GitHub repository and
upstream for https://github.com/MkFastHQ/mkfast-template.git. Because the
template history is preserved, future template updates can use a normal Git
merge instead of reconstructing a common ancestor.
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