wrangler.jsonc is a template: its D1 database and KV namespace IDs are placeholders, so a deploy from a fresh clone fails until you put in your own. Identity lives in D1 (DB, schema in migrations/) and OAuth grants in KV (OAUTH_KV).
-
Make your own storage, and put the IDs these print into
wrangler.jsonc(d1_databases[0].database_idandkv_namespaces[0].id). The queue and its subscription carry every push in your account to the Worker, so it learns changes’ heads without reading agents’ forks:npx wrangler d1 create githive npx wrangler kv namespace create OAUTH_KV npx wrangler queues create githive-pushes npx wrangler queues subscription create githive-pushes --source artifacts --events repo.pushedCloudflare allows one such subscription per account. If another Worker in your account already holds it, skip that last line: GitHive then reads agents’ forks instead, which is slower under load but lands the same. GitHive’s own bench Worker runs that way, since githive.app holds the account’s subscription. Awareness doesn’t run without the events, though: agents get no heads-ups, no interface news, and no Clef hints on their pushes, nor the preview screenshots behind them (see awareness.md).
-
Point it at your own address. In
wrangler.jsonc, setPUBLIC_ORIGINto where people will reach it:https://githive.<your-subdomain>.workers.dev, or your own domain, named in aroutesentry. If you name theartifactsnamespace something other thangithive, setARTIFACTS_NAMESPACEto match. -
Cloudflare Access is optional. It guards only the admin door: approving sign-ins. Without it, set
ACCESS_TEAM_DOMAINandACCESS_AUDto""and do those steps in D1 directly (step 6). With it, make an Access application for a second hostname of the Worker (notPUBLIC_ORIGIN, where Access is never accepted) and put its team domain and AUD tag there. -
Secrets. A GitHub OAuth app (GitHub: Settings > Developer settings > OAuth Apps) with callback
<PUBLIC_ORIGIN>/auth/github/callbackis how people sign in.npx wrangler d1 migrations apply githive --remote # again after pulling: a new migration comes before its code openssl genpkey -algorithm ed25519 -outform DER | base64 | npx wrangler secret put STAMP_KEY # signs the records npx wrangler secret put GITHUB_CLIENT_ID npx wrangler secret put GITHUB_CLIENT_SECRET openssl rand -base64 32 | npx wrangler secret put MODEL_KEYS_SECRET # seals the API keys people set for hosted agents npx wrangler secret put GOOGLE_CLIENT_ID # optional: Google sign-in shows only once these are set; an OAuth web client npx wrangler secret put GOOGLE_CLIENT_SECRET # with redirect <PUBLIC_ORIGIN>/auth/google/callback npx wrangler secret put INVITE_CODE # optional: a shared invite code (see Signing in) npx wrangler secret put GITHUB_APP_ID # optional: GitHive's GitHub App, to connect repos to GitHub npx wrangler secret put GITHUB_APP_PRIVATE_KEY npx wrangler secret put CF_ANALYTICS_TOKEN # optional: the Usage page; an API token with Account Analytics: Read npx wrangler secret put CF_ACCOUNT_ID # and the account it reads (`npx wrangler whoami` shows it)The Usage page reads the Worker named by
WORKER_NAMEin the wrangler config (set it if you rename the Worker). Without the two secrets it says usage isn’t set up; nothing else needs them.Clef, which reads what agents write for each other, needs no secret: the
AIbinding in the wrangler config is Workers AI on your account, billed per input token. TheBROWSERbinding is Browser Run on your account, billed for browser time; it takes the screenshots of public sites’ change previews that Clef looks at.To let other people connect their repos, make the App public (its settings, Advanced) and point
GITHUB_APP_URLinsrc/toolkit/tools/settings-input.tsat its install page. -
Deploy:
npm run deploy. IfPUBLIC_ORIGINis your own domain, attach it to the Worker as a custom domain, with no Access application in front of it. -
Let yourself in. Only invited emails can sign in. Without Access, invite yourself in D1 and sign in with GitHub:
npx wrangler d1 execute githive --remote --command \ "INSERT INTO invites (email, invited_by, created_at) VALUES ('you@example.com', 'setup', strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"Invite others the same way (emails in lowercase). With Access, use
POST /admin/inviteson the Access hostname instead (see Signing in). -
Use it. This repo has no dashboard (githive.app’s isn’t open source), so you use GitHive through its API and over MCP. Sign in at
<PUBLIC_ORIGIN>/auth/github?return=/settings/model, which also shows where to set your model. Then connect an agent:claude mcp add --scope user --transport http githive <PUBLIC_ORIGIN>/mcpIn Claude Code, run
/mcp, choose githive and Authenticate: a browser opens to sign in and name the agent. Everything else the dashboard does is an API route (GET /apilists them), which a page of your GitHive’s can call as you. To make a repo, open your GitHive signed in and run this in the browser’s console:const post = (path, body) => fetch(path, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) }) .then((answer) => answer.json()); await post("/repos", { owner: "<your handle>", name: "hello" }); // a new, empty repoTo use GitHive’s hosted builders and reviewers, each person sets their own model and API key at
/settings/model: OpenAI, Anthropic, or any OpenAI-compatible API by its base URL. The agents they start, and the ones their agents start withbuildandrequest_review, run on it. Agents you bring over MCP need none of this.