NotionCode turns a Notion ticket into an AI coding run, then writes the result back to the same card.
It supports two paths:
notioncode listen, which starts the local listener for Notion webhooks and link clicksnotioncode runandnotioncode start <page_id>, which are the manual fallback flows
- Watches for
comment.createdwebhook events atPOST /webhook - Accepts local link starts at
GET /start?page=... - Exposes
GET /healthandGET /status - Auto-creates the
NotionCode LinkURL property when the listener starts - Runs one ticket at a time and writes status updates and PR links back to Notion
- Falls back across providers in this order: OpenAI, Anthropic, Gemini
- Copy
.env.exampleto.env - Set the required values:
NOTION_TOKENNOTION_DATABASE_IDTARGET_REPO_PATH
- Set one agent key:
OPENAI_API_KEY, orANTHROPIC_API_KEY, orGEMINI_API_KEY
- Optional overrides:
NOTIONCODE_PORTorPORTNOTIONCODE_WEBHOOK_PATHor/webhookNOTION_API_BASE_URLAGENT_PROVIDERAGENT_RUNNER
Run setup check:
bun run src/index.ts setupThat command validates the required env vars, checks the agent configuration, probes Notion, and prints the local listener and ngrok guidance.
- Start the listener:
bun run src/index.ts listen- If you are demoing webhooks, expose the local port with ngrok and point Notion to
POST /webhook. - If you are demoing the fallback path, use
bun run src/index.ts runorbun run src/index.ts start <page_id>. - Show the Notion card move through In progress, then Done or Failed.
