Skip to content

Deploy

Run these from your scaffolded instance directory (for example my-notes) once you have composed your providers in src/index.ts and set up your AI Gateway.

Terminal window
bunx wrangler login
bunx wrangler d1 create my-notes-db # put database_id in wrangler.jsonc
bunx wrangler d1 migrations apply my-notes-db --remote
cp .dev.vars.example .env && $EDITOR .env # fill the secrets you need
bun run doctor # verify config before deploying
bunx wrangler deploy --secrets-file .env # code + all secrets in one shot

After d1 create, copy the printed database_id into the d1_databases block of your wrangler.jsonc. The migrations command applies the bundled D1 schema to the remote database.

A Durable Object only registers its cron schedule the first time it starts. After a fresh deploy, use the notewright CLI to link the instance and run start, which wakes every Durable Object so each one’s onStart() runs and (idempotently) registers its schedule:

Terminal window
bun install -g @notewright/core # or prefix the commands below with `bunx @notewright/core`
notewright login https://<host> # prompts for SYNC_SHARED_SECRET, links the instance
notewright start # wakes every DO and prints the schedules each registered

notewright start wakes all of the agents in one call and shows the schedules each registered, so there is no need to hand-roll requests per agent. The speaker-context agent needs no wake call; it is invoked on demand by the follow-up pipeline.

See the CLI overview for how linking and authentication work, and Syncing & backfill for what to do next.

  • The Worker (@notewright/core composed with your providers), bundled by Wrangler.
  • Two core Durable Objects, FollowUpAgent and SpeakerContextAgent, plus any DO contributed by your notes source (Granola contributes GranolaSyncAgent).
  • The D1 database bound as DB.
  • All secrets from your .env, applied in the same deploy call via --secrets-file.

See the Configuration reference for the full list of secrets and variables, and doctor preflight for catching configuration drift before it reaches production.