Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Self-host Mellon on your own Cloudflare account

Run Mellon on your own Cloudflare account with a single command. No git clone, no build step, no wrangler config:
npx mellon self-host
The command provisions a Worker and a D1 database on your account, applies the database migrations, uploads the latest Mellon release, and prints your instance URL. The whole thing runs on Cloudflare's free plan.

What it does

npx mellon self-host │ ├──> 1. Log in to Cloudflare (reuses wrangler login when present) ├──> 2. Download the latest prebuilt Mellon release bundle ├──> 3. Create a D1 database ──> apply migrations ├──> 4. Upload the Worker with static assets and bindings ├──> 5. Enable your workers.dev URL └──> 6. Optionally attach a custom domain
Authentication with your instance just works: the deployed app registers itself with the hosted Mellon auth provider on first load, so you sign in with the same login as mellon.jsj.sh. There are no OAuth keys to configure.

Cloudflare credentials

The command finds credentials in this order:
  1. CLOUDFLARE_API_TOKEN environment variable (or --api-token)
  2. Your existing wrangler login (refreshed automatically if expired)
  3. A login saved by a previous self-host run
  4. Interactive: an OAuth browser login, or a pre-filled API token creation link you can open from any device

Updating

Re-run the same command anytime to update to the latest release:
npx mellon self-host
Re-runs are idempotent: only new database migrations are applied, unchanged assets are skipped, and your auth secret is never rotated, so your stored secrets stay decryptable.

Backup and restore drills

Create an encrypted D1 backup before migration or key rotation:
MELLON_BACKUP_PASSPHRASE='<long unique passphrase>' \ mellon backup create --name mellon --out ./mellon-backup.json
Use mellon backup verify regularly. A restore drill creates a new quarantine D1 database, verifies its schema and record counts, and leaves the active Worker binding unchanged. See backup.

Options

See the full flag reference at mellon self-host.
OptionDescription
--name <name>Worker name (default: mellon)
--account <id>Cloudflare account id (skips the account prompt)
--api-token <token>Cloudflare API token
--domain <hostname>Attach a custom domain (the zone must be on your account)
--skip-domainSkip the custom domain prompt
--yesAccept all defaults, non-interactive
Non-interactive example for CI or agents:
CLOUDFLARE_API_TOKEN=xxx npx mellon self-host --yes

Using your instance

Point the CLI at your deployment with --api-url:
mellon login --api-url https://mellon.<your-subdomain>.workers.dev
Then everything works exactly like the hosted service:
mellon setup mellon run -- next dev
Deploying over SSH? Pick the API token option: the pre-filled link opens on your phone or laptop and you paste the token back into the terminal.