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.
Deploy steps
Section titled “Deploy steps”bunx wrangler loginbunx wrangler d1 create my-notes-db # put database_id in wrangler.jsoncbunx wrangler d1 migrations apply my-notes-db --remotecp .dev.vars.example .env && $EDITOR .env # fill the secrets you needbun run doctor # verify config before deployingbunx wrangler deploy --secrets-file .env # code + all secrets in one shotAfter 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.
Wake the agents
Section titled “Wake the agents”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:
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 instancenotewright start # wakes every DO and prints the schedules each registerednotewright 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.
What gets deployed
Section titled “What gets deployed”- The Worker (
@notewright/corecomposed with your providers), bundled by Wrangler. - Two core Durable Objects,
FollowUpAgentandSpeakerContextAgent, plus any DO contributed by your notes source (Granola contributesGranolaSyncAgent). - The D1 database bound as
DB. - All secrets from your
.env, applied in the samedeploycall 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.