appflare-cli-deploy

Configure, generate, migrate, and deploy Appflare backends on Cloudflare Workers.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Imtiajrex/appflare-skills --skill appflare-cli-deploy-imtiajrex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: appflare-cli-deploy
Source: https://github.com/Imtiajrex/appflare-skills/tree/main/skills/appflare-cli-deploy
Command: npx skills add https://github.com/Imtiajrex/appflare-skills --skill appflare-cli-deploy-imtiajrex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up and shipping an Appflare backend on Cloudflare Workers involves many moving parts: writing appflare.config.ts, creating D1/KV/R2/Queue resources, running migrations, managing secrets, and deploying with Wrangler. This Skill guides an AI agent through the entire lifecycle so configuration errors, stale migrations, and deploy mistakes are avoided. ## Core Features & Use Cases - Configuration authoring: Write and validate appflare.config.ts covering D1 databases with query limits, KV namespaces, R2 buckets, Better Auth options, scheduler queues, realtime Durable Objects, and wranglerOverrides. - CLI workflow: Run Bun CLI commands such as dev, dev --watch, build --no-build, migrate --local/--remote/--preview, migrate:custom for hand-written SQL migrations, and add-admin for creating admin users. - Deployment checklist: Follow production steps including wrangler secret put for BETTER_AUTH_SECRET, ALLOWED_DOMAINS CORS configuration, and wrangler deploy. - Use Case: You are starting a new Appflare project and need to create Cloudflare resources, wire up the config with real resource IDs, run the first local migration, and then ship to production with secrets and CORS locked down. ## Quick Start Ask the agent to set up a new Appflare backend on Cloudflare Workers, generate the config and wrangler bindings, run the local migration, and deploy it to production.

Frequently Asked Questions about appflare-cli-deploy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy an Appflare backend to Cloudflare Workers?▼

Run bun appflare build, then bun appflare migrate --remote after reviewing the SQL, set secrets with wrangler secret put BETTER_AUTH_SECRET, configure ALLOWED_DOMAINS in wranglerOverrides.vars, and finish with bunx wrangler deploy.

How do I run database migrations for an Appflare D1 database?▼

Use bun appflare migrate with one target flag: --local, --remote, or --preview. The command regenerates artifacts, runs drizzle-kit generate, and applies migrations via wrangler d1. For hand-written SQL like triggers or backfills, use bun appflare migrate:custom --name your_migration.

What goes in appflare.config.ts for Cloudflare bindings?▼

The config declares database (D1 binding, name, id, optional query limits), kv, r2, auth (Better Auth options), scheduler queue, and wranglerOverrides. Only the first database, kv, and r2 entries are used, and wranglerOverrides merges deeply while arrays replace generated arrays.

Why does the Appflare CLI fail with 'must be run with Bun'?▼

The Appflare CLI only runs under Bun, not Node.js, and requires Bun >= 1.3.9. Invoke every command with bun appflare from the backend package, optionally passing -c to point at a specific config file.

Why did my wrangler deploy serve the wrong entry file?▼

The generated wrangler.json main defaults to ./src/index.ts, which is not the built server. Set wranglerOverrides.main to ./_generated/server.js so Wrangler deploys the generated output instead of source files.

How do I create an admin user in an Appflare app?▼

Run bun appflare add-admin with -n, -e, -p and a target flag like --local or --remote. It requires Better Auth's admin() plugin for the role and banned columns, and the database must already be migrated.