Deploy your fork
The starter ships the way wrktr itself does: every landing deploys to dev, and a promote ships what’s on dev to production. Your fork’s environments start out not set up, because secrets aren’t copied with a fork. Three things make them yours, once.
1. An API token
Section titled “1. An API token”In the Cloudflare dashboard, go to Manage Account > Account API Tokens > Create Token, with one permission: Account, Workers Scripts, Edit. Store it as the project’s secret from stdin, so it never lands in your shell history:
pbpaste | wrktr secret set CLOUDFLARE_API_TOKEN # macOS, from the clipboardxclip -o | wrktr secret set CLOUDFLARE_API_TOKEN # Linux, from the clipboardwrktr secret set CLOUDFLARE_API_TOKEN < token.txt # or from a file (delete it after)The deploy never sees the token itself: its requests to the Cloudflare API get it from wrktr’s deploy gateway.
2. Your addresses
Section titled “2. Your addresses”The two urls in wrktr.json are the starter’s. Change them to your Workers’ addresses:
"dev": { "url": "https://wrktr-starter-dev.<your-subdomain>.workers.dev", ... },"production": { "url": "https://wrktr-starter.<your-subdomain>.workers.dev", ... }wrktr checks each deploy is served there. Rename the Workers in wrangler.jsonc if you like.
Make this change on a branch, like any other (wrktr branch new my-urls), and land it.
3. The account, only if needed
Section titled “3. The account, only if needed”wrangler.jsonc names no account, so a deploy goes to the one your token can reach. A token for several accounts
needs "account_id": "<your account id>" in wrangler.jsonc.
Ship it
Section titled “Ship it”The next landing deploys to dev by itself. Then:
wrktr env ls # what's live where, and what production is behindwrktr env logs dev <run> --follow # stream a deploywrktr env promote production # ship what dev has to productionwrktr env promote production <commit> ships a specific commit (all 40 characters) that passed dev; an older one
than what’s live is a rollback.
Every deploy serves /.well-known/wrktr.json (the project, environment, commit and run), added by wrktr with no
change to the app, and wrktr env ls shows each environment as serving or not. See
Environments.
Add another environment
Section titled “Add another environment”An environment is a few lines of wrktr.json. A staging that deploys only when the app’s code changes, say:
"staging": { "on": "land", "changed": ["src/**", "public/**"], "url": "https://wrktr-starter-staging.<your-subdomain>.workers.dev", "secrets": ["CLOUDFLARE_API_TOKEN"], "steps": [{ "name": "deploy", "run": "WRANGLER_SEND_METRICS=false npx wrangler deploy --env staging" }]}with a matching staging env in wrangler.jsonc ("staging": { "name": "wrktr-starter-staging" }). The
wrktr.json reference has every field.