Documentation
Installing Heddle on a new site
This page takes your site from an empty folder to live with Heddle, in order. Your repository gets a heddle/ folder with your company's facts and settings, your build runs Heddle's generate, aeo and check steps, and the launch checklist goes to all PASS. heddle install does most of it in one command, and heddle launch checks every step outside the repository, from your Cloudflare zone to the agents' GitHub secrets.
Installing on a new property
From an empty folder (or an existing site) to built, checked and with the agents reporting, using only Heddle's commands. Heddle sits beside the site (../heddle) or HEDDLE_DIR points at it.
Start with heddle onboard. It is the guided way through everything below:
node ../heddle/bin/heddle.mjs onboard my-site --from-url https://www.brand.example
node ../heddle/bin/heddle.mjs onboard my-site --continue # later, or straight away
- It asks for every value
heddle/needs, in order. The company, what it sells, where it is, who approves and writes, who the pages are for, what may be claimed, voice and search, the brand kit (optional), where the site runs, and how far the agents go. Each question says why it is asked, shows its default and is checked against the schema before it is kept. Agents start atreport; nothing starts atmergefrom here. - It reads before it asks. The git user becomes the approver, the origin remote (or
gh repo view) the repository, andcf auth whoamiplus the zone lookup the Cloudflare account. Two accounts and no zone to decide between them. It names both and picks neither. --from-urldrafts from the company's own site, and a draft is never written until a person confirms it. A claim about a client, award or partner is drafted only with the sentence on the page that says it, needs an explicit yes, and is written with who approved it and on what day.- It stops and resumes. Answers are kept in
heddle/.onboard.json, which it adds to.gitignore(it holds unconfirmed drafts, and agents readheddle/as fact). Run it again to carry on; it lists what is still missing. - It never asks for a secret. For each credential it names the variable, where to get it and the command that stores it (
gh secret set,npx wrangler secret put), and says which oneslaunch --applymakes itself. An answer that looks like a token is refused. --continueruns the rest through the CLIs.heddle install, the cf sign-in (a browser opens at a terminal), the zone check (per account; a zone in two accounts is never chosen),gh repo createafter the first commit and without pushing,gh secret setfor credentials already in your environment (on stdin, never printed),launch --apply, and after the first deploy,launch --applyagain and the watchdog. It stops with exit 3 at the first step only a person can do, or one that failed, and says exactly what it is. The registrar's nameservers, the first commit, the first push (a push to the default branch starts the deploy workflow, and the first deploy is a decision).- For agents and CI:
--answers file.json --non-interactiveapplies the same checks and fails listing what is missing;--questions --json(or the MCP server'sonboarding_questionstool) gives the questions to an agent that asks the person itself.
The steps it runs, by hand:
# 1. Once per machine, a person signs in to Cloudflare (a browser opens).
# From Heddle's folder, so the pinned cf is the one used.
(cd ../heddle && npm run cf -- auth login)
# 2. The company's facts: heddle onboard (above) writes heddle/. Without it,
# give the basics as flags and fill the rest of heddle/*.json afterwards
# (heddle validate names every REPLACE: left), or hand over a prepared
# heddle/ folder with --config. An existing heddle/ is never overwritten.
node ../heddle/bin/heddle.mjs install my-site \
--config path/to/prepared/heddle \
--app next \
--account <the Cloudflare account id that holds the zone> \
--no-launch
# or: --name "Brand" --url https://brand.example --contact hello@brand.example
# 3. Build and check.
cd my-site && git init && npm install
npm run build # heddle generate, next build, heddle aeo; the first build records the search surface
npm run check # validate, doctor, every gate
# 4. Push it to GitHub (the agents run there), then the outside steps.
gh repo create Owner/my-site --private --source . --push
# heddle install already switched the agents' Workflow runner on, once the
# repository is known: run `npm run heddle:update` after pushing if install
# said "the runner is not on yet".
npm run heddle:launch -- --apply # KV (ids written into wrangler.jsonc, HEDDLE_STATE among them), Email Routing, DMARC, tokens
git commit -am "KV ids" && git push
npm run deploy # the first deploy (wrangler's own sign-in, or the deploy workflow); creates the runner's Workflow
npm run heddle:launch -- --apply # again: the Worker exists now, so its shared secrets (the runner's too), the runner's URL variable and mail rules can be set
# The one manual step: GITHUB_DISPATCH_TOKEN on the Worker (launch prints how).
npm run heddle:launch # until nothing is TODO or FAIL; cut over last (uncomment the routes, deploy)
# 5. The agents' first runs: one slot through the runner, end to end, and the watchdog.
node ../heddle/bin/heddle.mjs runner start . canary --wait 30
node ../heddle/bin/heddle.mjs agent watchdog . --level report
heddle install writes.
heddle/ (from --config or templates/company), every managed template for the site's features (the Worker modules, the first-touch script, the build script, the agents and config-check workflows, and the ideas, approve and smoke workflows when the config calls for them), the Worker's entry and wrangler.jsonc once, package.json scripts and packages, the IndexNow key and its file, the pointer (or the skill) for coding agents in AGENTS.md and CLAUDE.md, and heddle/install.json, the record of what it installed.
With the Worker and the agents it also switches on the agents' Workflow runner. runtime.runner in autonomy.json, runner: "workflow" for every scheduled agent but the watchdog in agents.json, and the HEDDLE_FLOW binding and crons in wrangler.jsonc.
It needs the GitHub repository (an origin remote, or site.json launch.repo); without one it says so and heddle update switches it on later. --app next adds a starter Next.js site that reads every fact from heddle/. Then it runs heddle launch (skip with --no-launch; --apply passes through).
Later versions. heddle update <site> replaces each managed file with this Heddle's template and refuses one edited in the site (--force discards the edit).
Install and update record the Heddle commit they ran from in heddle/install.json ref, and every managed workflow checks Heddle out at that commit, so the agents, the deploy, the gates and the smoke run the Heddle the site was last updated with; run them from a Heddle checkout on main with no uncommitted changes.
The update agent moves the pin. Once a day it runs heddle update, the site's sync:heddle script when it has one, and heddle generate against Heddle's main, and opens one pull request when anything changed (kill switch HEDDLE_UPDATE, level in autonomy.json agents.update).
Before it proposes the pin it builds the updated site and runs the new Heddle's offline gates on it (heddle check --offline), and the pull request lists every failing check with its pages and reasons, so the site's older copy is fixed in the same pull request (16 October 2026).
A pass that fails or cannot be read is never marked as passed, so it waits for those fixes. To run an agent again by hand after a clean run, dispatch heddle-agents.yml with force ticked.
GitHub's job token may never push a workflow file, so an update that changes one needs the repository secret HEDDLE_UPDATE_TOKEN, a fine-grained token on the site's repository with Contents, Pull requests and Workflows write; without it the agent reports the update instead of opening it.
heddle doctor says how far behind main the pin is, warns when there is none, and fails one this Heddle cannot resolve.
heddle doctor <site> fails when a managed file differs from the template, when Heddle's machinery exists a second time in the site, or when config the installed features need is missing; npm run check and the config-check workflow run it, so drift fails the pull request that adds it.
Done when npm run build && npm run check pass, heddle launch shows nothing TODO or FAIL, and the watchdog's report is in heddle/reports/. npm run rehearse in Heddle runs steps 2, 3 and 5 for the fictional company in test/fixtures/new-property, plus a drift that doctor must catch.
What is still a person's, and why:
| Step | Why Heddle does not |
|---|---|
npm run cf -- auth login |
A browser sign-in, by design; everything after it is cf. |
| Adding the domain to Cloudflare and the registrar's nameservers | Changes who answers for the domain; the registrar is outside Cloudflare. |
GITHUB_DISPATCH_TOKEN (Worker secret) |
GitHub has no API that makes a fine-grained token. Make one for this repository only (Actions read and write) and npx wrangler secret put GITHUB_DISPATCH_TOKEN. The Workflow runner needs it to start any slot; until it is set, every slot falls to GitHub's own schedule. |
HEDDLE_NPM_READ_TOKEN (broker Worker secret) |
npm has no API that makes a granular token for someone else. Make one on npmjs.com, read-only on the @fabricorg packages, and npx wrangler secret put HEDDLE_NPM_READ_TOKEN from the broker site: the broker reads releases with it and serves them to its granted clients' workflows (/heddle/release), so no client holds an npm token. |
heddle app grant <broker-site> <owner> |
Who is a client is a business decision. The Heddle Agents app is public, so installing it alone gets no Heddle: the grant lets that GitHub account's repositories download releases. --revoke takes it away. |
HEDDLE_NPM_TOKEN (GitHub secret) |
Heddle's own sites only, never a client's: a read-only npm token, tried after the broker. The package stays private to the people who build Heddle. |
HEDDLE_REPO_TOKEN or HEDDLE_DEPLOY_KEY (GitHub secret) |
Instead of the npm token, or while the site's pin is not a release: read access to Heddle's private repository. |
HEDDLE_UPDATE_TOKEN (GitHub secret) |
The same again: Contents, Pull requests and Workflows write on the site's repository, so the update agent can push Heddle's workflow templates. |
PLUNK_API_KEY, TURNSTILE_SECRET_KEY, the AI Gateway token, DataForSEO, the Search Console key |
Each comes from another account; heddle launch names where. |
| Clicking the destination address's verification email | Cloudflare sends it to a person. |
| Search Console: adding the property and the service account | Google has no API for proving ownership of a new domain property. |
| The first deploy and the cutover | A deploy is a decision. Locally it needs wrangler's own sign-in (npx wrangler login); the deploy workflow uses the CLOUDFLARE_API_TOKEN that --apply stored. |
| The home page's copy | The helpful and buyer gates judge what only the company can say. The starter passes every offline gate; the model gates fail it until the copy says something only this company knows. |
Take it live
The order to take a new product site live with Heddle, and the command that checks every step. heddle launch <site-repo>. It is read-only. It prints each item as PASS, TODO (with the exact next action), FAIL (done wrong, or something in the way) or SKIP (could not be read, and why).
Run it at the start, after each step, and once more before cutover; the launch is done when nothing is TODO or FAIL.
heddle launch <site-repo> --apply does the safe steps the check found missing, and nothing else:
- creates the KV namespaces wrangler.jsonc needs and writes their ids into it (a commented-out placeholder for the binding is replaced in place);
- enables Email Routing on the zone (Cloudflare adds its own MX and SPF);
- adds the destination address (Cloudflare emails it a link to click);
- creates the
hello@<domain>routing rule, and the ideas address's rule to the site's Worker when ideas by email is set up; - creates
_dmarcwithp=none; - adds the domain to the Turnstile widget's hostnames, keeping the others;
- makes this property's own tokens and stores them as GitHub secrets. A deploy token (
CLOUDFLARE_API_TOKEN: Workers Scripts and KV write and Account Settings read on the zone's account, Workers Routes write and Zone read on the zone) and, whensite.jsonmodel.tokenEnvnames one, a Workers AI Read token for the judging model; - sets
CLOUDFLARE_ACCOUNT_IDas a GitHub secret (an identifier); - makes the secrets the Worker and the agents share (
HEDDLE_LEADS_TOKEN,HEDDLE_IDEAS_TOKEN, and the Workflow runner'sHEDDLE_RUNNER_SECRET) at random and sets each on both sides at once, but only when both sides lack it. A value already set on one side cannot be read back, so that case is left for a person. The runner's secret is then proved with a read of the runner's records signed with it; - sets the repository variable
HEDDLE_RUNNER_URL(where the agents' job reports to the runner) withgh, and makes the runner'sHEDDLE_STATEKV.
Every step goes through a CLI: Cloudflare's cf (the account always the one wrangler.jsonc names) and gh. The one credential no CLI can make is the Worker's GITHUB_DISPATCH_TOKEN (GitHub has no API for fine-grained tokens); its checklist item gives the exact steps.
The agents' GitHub App is made with --agent-app, a separate step with two clicks (step 8).
It only creates. It never edits or deletes a record it did not make, never overwrites a GitHub secret that is set, and refuses to enable Email Routing while another provider's MX records exist. That is a decision for a person. Records it creates carry the comment "created by heddle launch".
It lists every change before making it, then the result of each, and never prints a token or secret. Rerun without --apply to confirm.
Cloudflare through cf
cf is Cloudflare's own CLI (npm package cf, published by Cloudflare). Heddle pins it exactly (1.0.0-beta.14, in Heddle's package.json) and runs its own copy, never a global one. It is a beta.
A release can rename a command, so the pin moves only after npm test and a heddle launch against a real install pass on the new version.
- A person signs in once with
npm run cf -- auth login;heddle launchchecks the sign-in (cf auth whoami) and that it can see the account wrangler.jsonc names. The account is always passed explicitly (CLOUDFLARE_ACCOUNT_IDin cf's environment). A login that sees two accounts never picks one. - Each API call the launch makes is a cf command (lib/launch/cfcli.mjs
ROUTES). Request bodies go on stdin, so no secret is ever in a process list, and cf's output is parsed, never printed. - cf has no command for a Worker's custom domains or the account's workers.dev subdomain. Those two reads fall back to the raw API when
CLOUDFLARE_LAUNCH_TOKENorCLOUDFLARE_API_TOKENis set, and are SKIP otherwise. CLOUDFLARE_LAUNCH_TOKEN, when set, still wins. The raw API with that token, as below.HEDDLE_CF=offturns cf off.
The launch token (without cf)
Only for a machine where cf cannot sign in. Create one token per Cloudflare account for launches, once:
- dash.cloudflare.com → the person icon, top right → My Profile → API Tokens → Create Token → Custom token: Get started.
- Name it
Heddle launch (<account>). - Add the nine permissions in the table below, one row each (+ Add more). The first dropdown is Account or Zone, the second the permission, the third Read or Edit.
- Account Resources: Include → the account the sites deploy to. Zone Resources: Include → All zones from an account → the same account, so the next domain needs no new token.
- Leave Client IP filtering empty. Set a TTL if you want it to expire.
- Continue to summary → Create Token, and copy it once. It is not shown again.
- Keep it in your password manager or a secrets file outside any repository (readable only by you,
chmod 600), asCLOUDFLARE_LAUNCH_TOKEN=...on its own line. Check first that the file ends with a newline, or the new line glues onto the previous secret. - Check it.
curl -s -H "Authorization: Bearer $CLOUDFLARE_LAUNCH_TOKEN" https://api.cloudflare.com/client/v4/user/tokens/verifysays"status":"active".
Keep it out of every repository and every GitHub secret. Launches run from a person's machine, never from CI.
| Scope | Permission | Used for |
|---|---|---|
| Zone | Zone: Read | finding the zone and its account |
| Zone | DNS: Edit | reading records; creating _dmarc |
| Zone | Email Routing Rules: Edit | reading and creating the hello@ rule |
| Zone | Zone Settings: Edit | Email Routing status, and enabling it (the enable endpoint needs Edit) |
| Account | Email Routing Addresses: Edit | listing and adding destination addresses |
| Account | Turnstile: Edit | reading and updating the widget's hostnames |
| Account | Workers KV Storage: Edit | listing and creating KV namespaces |
| Account | Workers Scripts: Read | the Worker, its custom domains, secret names, workers.dev |
| Account | Account Settings: Edit | listing and creating the Web Analytics site, when site.json analytics is on |
Limit it to the zones it launches. Without it the check falls back to CLOUDFLARE_API_TOKEN and reports whatever that token cannot read as SKIP. --apply never borrows another token.
The steps
1. Domain. Register it, then add it to Cloudflare (Add a site) in the account the Worker deploys to. Custom domains attach only from the zone's account; the check fails a zone in a different account from wrangler.jsonc's account_id. Set the registrar's nameservers to Cloudflare's.
2. Email in: Cloudflare Email Routing, free. A product domain needs an address people can write to, and no mailbox of its own. Email Routing forwards hello@<domain> to an existing inbox, such as the team's Google or Microsoft mailbox. There is nothing to buy.
--apply enables it, adds the destination (click the link Cloudflare sends) and creates the rule. The destination is site.json launch.emailRoute.to, or the Worker's CONTACT_TO. If the domain already has MX records from Google or Microsoft, keep them and create the alias there instead; the check stops and leaves them in place.
Replying as hello@<domain> from Gmail is optional. Add it under Gmail → Settings → Accounts → "Send mail as", using the Plunk domain's SMTP details or another relay. Most teams reply from their own address, which is what the follow-up agent's drafts assume.
3. Email out: Plunk. The contact form, the agents' reports and approval links all send through Plunk. In Plunk → project settings → Domains → Add <domain>. It shows three DKIM CNAMEs, an SPF TXT and a bounce MX on the plunk. subdomain.
Add them in Cloudflare DNS, set to DNS only (grey cloud), then press Verify in Plunk.
Do not add Plunk's inbound MX. Plunk also offers an MX at the domain itself, inbound-smtp.<region>.amazonaws.com, for receiving mail into Plunk. Sending does not need it, and while it exists Cloudflare Email Routing will not enable. The Activate button shows "Existing non-Cloudflare MX records conflict with Email Routing" or appears to do nothing.
If it was added, delete that one record (the MX at the bare domain pointing to amazonaws.com), keep the plunk.<domain> MX, and enable Email Routing again. The check names this record when it finds it.
- SPF: merge Plunk's include into the one SPF record. A domain may have only one; the check fails two.
- The sender: once Plunk verifies the domain, set
MAIL_FROMin wrangler.jsonc tonoreply@<domain>. Until then it can stay on a domain Plunk already verified. - How the check reads Plunk:
- from Plunk's API, with
PLUNK_PROJECT_IDset besidePLUNK_API_KEY(a secretsk_key); - otherwise from DNS, with the records copied into
site.json launch.plunk.records.
- from Plunk's API, with
3b. Your own mail filter. A brand-new sending domain is what phishing looks like, so the company's filter may quarantine its first mail. On one of our own sites, Microsoft Defender quarantined two short test emails sent straight to the CEO as "Phish", while the contact form's mail to a shared inbox got through.
Plunk still reports quarantined mail as Delivered (and the scanner's link check as Opened and Clicked), so look in the quarantine at security.microsoft.com → Email & collaboration → Review → Quarantine.
Select the domain's messages → More → Submit to Microsoft for review → "should not have been blocked" → Allow this message, with "45 days after last used date" (the agents' weekly mail keeps it alive), then Release.
Allow entries for a sending domain can only be made from a submission; the list itself takes no typed entry. Test with a real notification. A one-line "test" with a single link scores as phish on its own.
4. DMARC. --apply adds v=DMARC1; p=none at _dmarc, with rua=mailto: set to site.json launch.dmarcRua when given. Gmail and Yahoo require a DMARC record from bulk senders. Move to p=quarantine once reports show only Plunk and Cloudflare sending.
5. Turnstile, before cutover. The contact form's widget must list the domain, or every enquiry from it is refused from the minute the domain goes live. Dashboard → Turnstile → the widget → Hostnames → Add <domain> and www.<domain>. The check reads the site key from .env.local (NEXT_PUBLIC_TURNSTILE_SITE_KEY).
--apply adds the domain and keeps the existing hostnames (the workers.dev preview, other sites).
Pages served somewhere else. When the site's pages come from another host (Vercel, say) and its forms post to the Worker on a host of its own, set site.json contact.cors: origins, the exact https origins the pages are served from, and, for preview deployments, previewPattern, an anchored regular expression such as ^https://[a-z0-9-]+-team\.vercel\.app$ (in JSON, each \ doubled).
The form endpoint then answers the browser's preflight and lets those pages, and only those, read its answers. You are done when an OPTIONS to the contact path with Origin: <the site> answers 204 with that origin in Access-Control-Allow-Origin, and one from any other origin answers 403.
A site's own endpoints (a newsletter signup) take the same setting through worker/heddle-cors.ts. Without it the browser refuses every cross-origin answer, so the visitor sees the form fail even when the enquiry was sent. It never allows *: the form carries a Turnstile token.
6. Deploy. In the site, for each missing KV binding (--apply creates them and prints the ids) and each missing secret: - npx wrangler secret put PLUNK_API_KEY - npx wrangler secret put TURNSTILE_SECRET_KEY - npx wrangler secret put HEDDLE_LEADS_TOKEN
Then npm run deploy (heddle deploy run . --local), which builds, runs every gate and deploys. That is the only deploy from a laptop. After step 8 the site deploys from CI (deploy.md). The Worker serves X-Robots-Tag: noindex on workers.dev, so the preview never competes with the domain; the check fails a preview without it.
7. Search Console. Add a Domain property for <domain> (verify with the TXT record in Cloudflare DNS). Then Settings → Users → add the service account as Restricted. The check reads the property list with the service-account key.
7b. Bing Webmaster Tools. Bing's index feeds Bing, Copilot and ChatGPT search, and Google's tools see none of it. 1. bing.com/webmasters → sign in → Import from Google Search Console. It verifies the domain and brings the sitemap with it.
Without a Search Console property, verify with the XML file or the DNS record instead. 2. Sitemaps → check https://<domain>/sitemap.xml is listed, or submit it. 3. IndexNow (step 9) reports into the same account under IndexNow.
- For the agents: Settings → API access → Generate API key, add
"bing": trueto site.jsondata.providers, and set the key asBING_WEBMASTER_API_KEYin the shell and as a GitHub secret.
It is done when Bing lists the sitemap as processed. From the first week, read Search Performance and AI Performance (citations in Copilot and Bing's AI answers) there each week. Do not measure Bing through DataForSEO.
Its Bing endpoint returned results for unrelated searches when tried on 10 September 2026, so Webmaster Tools is the only Bing reading worth having.
7c. Search data providers. Declare in site.json data.providers the providers the install will use (DataForSEO, Search Console and PageSpeed at least; Bing and OpenSEO when someone has made their keys). heddle launch lists them under "Search data" with each missing credential and what to create, and heddle data <site> status shows which capability each answers.
It is done when every provider declared reads PASS.
8. GitHub: the agents. - Copy templates/github/heddle-agents.yml to .github/workflows/. - Create the agents' GitHub App. heddle launch <site> --agent-app (below, The agents' GitHub App). - Set the secrets the check lists, from wherever you keep them, with gh secret set NAME -R Owner/site. Never echo a value. - Give the workflows Heddle.
A site in a client's own organisation gets it from the broker. Set site.json identity.broker, install the Heddle Agents app, pin a release with heddle update, and have the broker's operator run heddle app grant <broker-site> <owner>; every workflow but the fork checks then downloads the pinned release with its ID token.
A site of ours may use HEDDLE_NPM_TOKEN (read-only on @fabricorg) or HEDDLE_REPO_TOKEN, a fine-grained token on the Heddle repository with Contents read-only. Deploy keys are disabled in the org. A fork's pull request is never served by the broker (no ID token).
On a broker-only site its checks cannot read Heddle, and a maintainer pushes the branch to the repository to have it judged. - Enable the workflow and run the watchdog once by hand. gh workflow run heddle-agents.yml -f agent=watchdog. - Copy templates/github/heddle-deploy.yml too and set CLOUDFLARE_API_TOKEN (permissions in deploy.md).
From then on every push to the default branch, every merge an agent makes and a daily run deploy from CI, and each deploy is proven live before it counts as done.
Every agent starts at report; autonomy.json says which move up.
9. Cutover, last. Step 5 (Turnstile) must be done first. 1. Uncomment the <domain> and www.<domain> custom-domain routes in wrangler.jsonc and npm run deploy. Remove the HEDDLE_SITE_URL repository variable and point runtime.leads.url at the domain. 2. Run the check again: Custom domain, the live llms.txt, sitemap, robots and the contact endpoint should all PASS. 3.
Send one real enquiry through the form and see it arrive. 4. Submit the sitemap in Search Console. 5. IndexNow. heddle indexing key <site> once (commit site.json and the key file, deploy). The deploy workflow submits after every deploy and owns heddle/indexing.json; a laptop never submits (deploy.md).
Optional. Blog ideas by email. When autonomy.json has runtime.ideas, the check adds an "Ideas by email" section.
The routing rule for the ideas address must send to the site's Worker (not forward to a mailbox), the Worker must bind IDEAS and have HEDDLE_IDEAS_TOKEN and GITHUB_DISPATCH_TOKEN, each author's domain should publish DMARC, and the repository needs the heddle-ideas workflow and its secret. --apply never creates that rule.
Where mail goes is a person's decision. The whole setup is in ideas-by-email.md.
Optional. Analytics. When site.json analytics turns anything on (measuring.md, Visitors and clicks), the check adds an "Analytics" section.
With provider: "cloudflare-web-analytics": a Web Analytics site for the domain, whose public site token site.json carries (--apply creates the site with automatic setup off, or records the token of the one that exists, and writes it into heddle/site.json; then build and deploy), automatic setup off (a TODO with the cf command, never applied.
It is a setting launch did not make), and the live home page loading the beacon with that token. With ctaClicks: true: the CTA_CLICKS KV namespace (with the other KV), the Worker answering a probe at the CTA path without counting it, and the counts readable with HEDDLE_LEADS_TOKEN.
The privacy page is the build's business, not launch's. The analytics check fails a build whose privacy page does not match.
The agents' GitHub App
Each install's agents open, push and merge as their own GitHub App, named "<Site> Site Agents", so their pull requests run the repository's real checks and a merge waits for them (reliability.md, Real checks).
Steps.
- Run
heddle launch <site> --agent-appon a machine with a browser, signed in toghas an owner of the site's GitHub account. - Open the address it prints. It serves a page on 127.0.0.1 that posts Heddle's manifest to GitHub. Click Continue to GitHub, then Create GitHub App.
- GitHub returns to the page with a one-time code. Heddle exchanges it (
gh api -X POST app-manifests/<code>/conversions) and stores the id and private key asHEDDLE_AGENT_APP_IDandHEDDLE_AGENT_APP_PRIVATE_KEYwithgh secret set. Neither value is printed or written to disk. Before anything is created it proves gh's JSON is readable (a version manager's shim that prints on gh's stdout once broke the exchange, 16 October 2026. Gh runs withMISE_QUIET=1and every answer is read past stray lines). If the conversion's answer still cannot be read, the code is already spent, so Heddle saves the answer to a file only you can read and names it; finish withheddle launch <site> --agent-app --conversion <file>, then delete the file. It also writesheddle/agent-app.jsonwith the app's id, slug and permissions, which are identifiers, not secrets. Commit that file. - Open the install link it prints, choose Only select repositories, pick the site's repository, and click Install. Heddle waits until the app can see the repository.
From a remote shell, where a browser cannot reach the listener, add --no-listen. Heddle writes the page to .heddle-cache/agent-app.html. After Create GitHub App the browser lands on a page that does not load. Copy the code= value from its address bar and run heddle launch <site> --agent-app --code <code> within the hour.
If the name is over GitHub's 34 characters, or is taken, pass --app-name.
What the manifest asks for. Contents, pull requests, issues and actions write; checks, commit statuses and metadata read; workflows write. Workflows write is there for the update agent alone, which pushes Heddle's workflow templates.
Statuses are read so a merge can wait on an outside CI that reports through the statuses API; the app can never write one, so nothing an agent does may certify its own commit. The webhook is inactive and the app is private, so it installs only on its owner's account.
Each workflow's token carries only what that workflow declares, never the app's whole set.
Done when heddle launch <site> shows Agent identity PASS and heddle doctor <site> --github passes its Identity area. Its last check is the outcome that matters. The latest agent pull request got check-runs.
Without it the agents still run, on the self-certified fallback. Each agent runs the gate itself, posts a gates status and dispatches the deploy. Every report and heddle doctor warn until the app is set up.
An older install with HEDDLE_UPDATE_TOKEN keeps it for the one update that brings in the app's templates; delete it afterwards. HEDDLE_REPO_TOKEN (or HEDDLE_DEPLOY_KEY) stays, because the app is installed on the site's repository only and cannot read Heddle's.
Submitting a new domain in batches
A new domain puts its core pages in front of Google first. The home page, pricing, the product pages, the hubs and the landing pages written for the highest-demand searches.
Its programmatic families (comparisons, alternatives, tools, learn pages, locations and the like) follow in batches, each only once Google has indexed enough of what it was already sent.
- What it does. With site.json
launchRampon (by default for the first 90 days aftersurface.launched),heddle aeotakes every programmatic page that is not yet admitted out of the built sitemap, so neither Google nor IndexNow is sent it, and lists them all in/heddle-ramp.json. Those pages stay live and linked. Once a day the watchdog reads how much of the submitted sitemap Google has indexed (its index-health record) and, atadvanceAtShare(half) of at leastminKnownURLs andminDays(7) since the last batch, proposes the nextbatchSize(10) as a pull request changingheddle/ramp.json: atmergeit merges itself and the deploy ships the new sitemap, atproposean approver merges it. Nothing advances atreport, while publishing is paused, or while the share is unknown. - You know it is working when the deploy log says how many programmatic pages were held back, the digest's Index health section shows the ramp, and
heddle/ramp.jsongrows a batch at a time. - Why. One of our product sites published about 124 pages within two days of its domain going live, every one in the sitemap and sent to IndexNow, and Google had indexed none of them (lessons.md).
Never move a dropped site to a new host
When Google drops a site (the watchdog's index-health pause), recover it where it is. Remove or improve the low-value pages in place, check Manual Actions, then set autonomy.json indexHealth.resumedAt.
Google's spam policies name using a new subdomain, subdirectory or site to keep doing what a policy action was taken for as a violation of its own, so moving the content only spreads the problem.
heddle doctor fails, and heddle launch --apply refuses, when an install whose site was dropped and not resumed now points at another host; both warn while a drop is recorded on the same host.
Settings it reads
Everything has a default; site.json launch overrides it.
| Field | Default |
|---|---|
worker |
wrangler.jsonc |
repo |
the git origin remote |
contactPath |
/api/contact |
emailRoute.local, emailRoute.to |
hello; wrangler.jsonc vars.CONTACT_TO |
dmarcRua |
none |
turnstileSitekeyEnv |
NEXT_PUBLIC_TURNSTILE_SITE_KEY |
workerSecrets |
PLUNK_API_KEY, TURNSTILE_SECRET_KEY, HEDDLE_LEADS_TOKEN |
kvBindings |
RATE_LIMIT, LEADS (and CTA_CLICKS with analytics.ctaClicks) |
plunk.projectIdEnv, plunk.records |
PLUNK_PROJECT_ID; none |
--preview <url> (or HEDDLE_SITE_URL) also checks the preview host's llms.txt, sitemap, robots and contact endpoint before the domain is attached.
Generated from the Heddle repository at 4ccdf8b.
Questions
How do I know the install is finished?
When heddle validate reports the folder valid, heddle check passes on the built site, and heddle launch shows nothing as TODO or FAIL.
Can the launch step change my DNS?
Only with --apply, and only by creating: KV namespaces, Email Routing, the hello@ rule, a DMARC record at p=none and Turnstile hostnames. It never edits or deletes a record it did not make, and it lists every change before making it.