LogoTanStarter Docs
LogoTanStarter Docs
HomepageIntroductionCodebaseCLIGetting StartedEnvironmentsDeployment
Configuration

Integrations

CloudflareDatabaseStorageCacheAuthenticationEmail
Payment
AINewsletterNotificationsAnalyticsChatbox

Customization

MetadataPagesInternationalizationLanding PageBlogComponentsUser ManagementAPI Key Management

Codebase

Project StructureFormatting & LintingEditor SetupUpdating the Codebase

Projects

MkImage
X (Twitter)

CLI

Deploy a TanStarter project to Cloudflare Workers with the TanStarter CLI

TanStarter CLI automates the full TanStarter setup and deployment flow. With one guided command, you can create a new project from the TanStarter template, prepare Cloudflare resources, configure environment files, deploy to Cloudflare Workers, and push the initialized code to GitHub.

If you already understand the manual steps in Getting Started, Cloudflare Configuration, and Deployment, the CLI is the fastest path. It turns those steps into a guided workflow that can deploy a new TanStarter project in about 5 minutes.

GitHub Repository

View the TanStarter CLI source code

Video Tutorial

Watch the CLI tool walkthrough

What It Does

The CLI runs the same work you would normally do by hand when launching a TanStarter project:

  1. Clones the TanStarter template.
  2. Installs dependencies with pnpm install.
  3. Checks local tools and Cloudflare credentials.
  4. Creates Cloudflare D1, R2, and KV resources.
  5. Updates wrangler.jsonc with your Worker, D1, R2, KV, and route settings.
  6. Writes .env and .env.production.
  7. Runs database migrations.
  8. Builds and deploys to Cloudflare Worker.
  9. Syncs runtime Worker secrets.
  10. Creates a private GitHub repository.
  11. Syncs GitHub Actions secrets.
  12. Commits and pushes the initialized project to main.

This makes the CLI useful when you want a production-ready starting point quickly, or want a repeatable setup flow for multiple TanStarter projects.

TanStarter CLI

Prerequisites

The CLI checks for node, pnpm, git, gh, GitHub CLI authentication, and Cloudflare credentials before it starts creating resources. If pnpm, git, or gh is missing, it attempts to install the missing tool with the available system package manager.

For local tools such as Node.js, pnpm, Git, and GitHub CLI, follow the Getting Started guide first. If you have not created a Cloudflare API token yet, follow the Cloudflare Configuration guide, then export CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your terminal.

Quick Deploy

Run the CLI directly with npx:

npx tanstarter-cli@latest create

TanStarter CLI will ask for the project name, GitHub repository, Cloudflare resource names, and optional domain settings before creating anything.

After the workflow completes, you will have:

  • A deployed Cloudflare Workers website.
  • A private GitHub repository with the TanStarter template.
  • Cloudflare D1, R2, and KV resources connected to the project.
  • Worker runtime secrets synced to Cloudflare.
  • GitHub Actions secrets synced for future automated deployments.

Install Globally

You can also install the CLI globally if you plan to use it often:

npm install -g tanstarter-cli

Then run:

tanstarter create

The global command supports the same options as the npx command.

Command Reference

tanstarter create [options]
tanstarter create <project-name> --resume
tanstarter delete <project-name> [options]
OptionDescription
--domain <domain>Configure a Cloudflare custom domain route for the deployed Worker.
--repo <owner/name>Create this GitHub repository. If omitted, the CLI uses your GitHub CLI login and project name.
--resumeContinue a failed setup from .tanstarter/state.json.

Resume a Failed Setup

If the setup fails after the project directory has been created, fix the reported issue and resume the workflow:

tanstarter create your-project-name --resume

The CLI stores setup progress in .tanstarter/state.json, so it can continue from the completed steps instead of starting over.

Delete Created Resources

To remove Cloudflare and GitHub resources created by the CLI, run:

tanstarter delete your-project-name

The delete command is destructive. Review the project name, GitHub repository, Worker, D1 database, R2 bucket, and KV namespace before confirming.

Video Tutorial

Next Steps

After deploying with the CLI, continue with the parts of the template you want to customize:

Website Configuration

Configure site metadata, navigation, footer, sidebar, and social links

Environment Configuration

Review generated environment variables and add provider-specific keys

Database

Manage Cloudflare D1 schema and migrations

Deployment

Learn the underlying deployment workflow

Table of Contents

What It Does
Prerequisites
Quick Deploy
Install Globally
Command Reference
Resume a Failed Setup
Delete Created Resources
Video Tutorial
Next Steps