Skip to content

dkeg/cal-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CalBridge

A native macOS menu bar app that fetches events from all your Google Calendars and posts a formatted weekly schedule to Notion and/or Obsidian β€” automatically every Sunday night, or on demand.


Compact popover
Hover to open
Preview events
Preview & edit events
Notion output
Posted to Notion


Demo

β–Ά Watch the demo on Loom

Features

  • πŸ—“οΈ Hover over the menu bar icon β€” events load instantly from cache
  • πŸ“… Fetches 1 week by default; modify to 1–4 weeks inline
  • ✏️ Preview and edit events before posting
  • πŸ“ Posts a beautifully formatted day-by-day table to Notion
  • πŸ““ Obsidian support β€” sync to your Obsidian vault via Local REST API plugin
  • πŸ”€ Sync target selector β€” choose Notion, Obsidian, or Both in Settings
  • πŸ” Auto-runs every Sunday at 9 PM via launchd
  • βœ‰οΈ Email notification on every post (manual and autorun)
  • πŸ’Ύ Persists posted state across relaunches β€” shows "Open in Notion" or "Open in Obsidian" when already posted
  • ✨ Autorun banner shows when the Sunday sync has fired
  • ⚠️ Warns if a page for that date range already exists

Install

Option A β€” Homebrew (recommended)

brew tap dkeg/cal-bridge
brew install --cask cal-bridge

Then run the setup script:

./scripts/install.sh

Option B β€” Direct download

  1. Download the latest CalBridge.dmg from Releases
  2. Open the DMG, drag CalBridge.app to /Applications
  3. Clone this repo and run the setup script:
git clone https://github.com/dkeg/cal-bridge.git
cd cal-bridge
chmod +x scripts/install.sh
./scripts/install.sh

Setup

Prerequisites

  • macOS 13+
  • Node.js 18+ (brew install node)
  • A Google account
  • A Notion account and/or Obsidian with the Local REST API plugin
  • A Resend account (free tier, for email notifications)

First-time setup

CalBridge includes a built-in setup flow β€” no terminal or config file editing required.

  1. Launch CalBridge.app from /Applications
  2. The setup window appears automatically on first launch
  3. Click Connect with Google β€” your browser opens for OAuth authorization
  4. Authorize access to Google Calendar
  5. Return to the app β€” it captures the token automatically
  6. Enter your Notion integration token (get it at notion.so/my-integrations)
  7. Click Finish Setup

Your credentials are stored securely in macOS Keychain β€” no .env editing needed.

Notion page setup

  1. Go to notion.so/my-integrations
  2. Create a new integration β†’ copy the Integration Token
  3. Open the Notion page you want to post under
  4. Click Β·Β·Β· β†’ Connections β†’ connect your integration

Obsidian setup

  1. Install the Local REST API plugin in Obsidian
  2. Copy the API key from the plugin settings
  3. Enter it in Settings β†’ Configuration β†’ Obsidian API Key
  4. Set your vault path and target folder

Resend (email notifications)

  1. Sign up at resend.com
  2. Copy your API Key from the dashboard
  3. Enter it in Settings β†’ Configuration β†’ Resend API Key

Usage

  1. Launch CalBridge.app from /Applications
  2. Hover over the calendar icon β€” events load instantly
  3. Optionally click Modify to change the number of weeks (1–4)
  4. Toggle calendars on/off, edit or remove individual events
  5. Click Post to Notion β†’, Post to Obsidian β†’, or Post to Both β†’ depending on your sync target
  6. Button changes to Open in Notion or Open in Obsidian once posted β€” persists across relaunches
  7. Change sync target anytime in Settings β†’ General

Autorun

The app runs automatically every Sunday at 9 PM via a launchd agent. After firing it:

  • Writes a flag file to ~/Library/Application Support/CalBridge/last-run.json
  • Sends an email notification to your configured address
  • Shows an "Auto-synced" banner the next time you open the popover

To set up or recreate the launchd agent:

launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.drewcraig.cal-bridge-autorun.plist

To test manually:

node ~/Projects/cal-bridge/backend/dist/autorun.js

Development

# Clone
git clone https://github.com/dkeg/cal-bridge.git
cd cal-bridge

# Backend
cd backend
cp .env.example .env
# fill in credentials
npm install
npx ts-node auth.ts   # get Google refresh token
npm start             # runs on localhost:8420

# Compile autorun
npx tsc agent.ts autorun.ts --outDir dist --esModuleInterop --resolveJsonModule --module commonjs --target es2020

# Swift app
open CalNotionBar/CalNotionBar.xcodeproj
# Build and run in Xcode (⌘R)

Releasing a new version

git tag v1.2.0
git push origin v1.2.0

GitHub Actions will automatically build the .dmg and create a release.


Architecture

CalBridge.app (Swift/SwiftUI)
  └── spawns β†’ backend (Express + TypeScript) on localhost:8420
                 β”œβ”€β”€ /calendars  β†’ Google Calendar API
                 β”œβ”€β”€ /events     β†’ Google Calendar API
                 β”œβ”€β”€ /today      β†’ Google Calendar API (badge count)
                 β”œβ”€β”€ /notion     β†’ Notion API + Resend email
                 └── /obsidian   β†’ Obsidian Local REST API

launchd agent (Sunday 9 PM)
  └── dist/autorun.js
        β”œβ”€β”€ reads sync target from app plist
        β”œβ”€β”€ fetches 1 week of events
        β”œβ”€β”€ posts to Notion and/or Obsidian
        β”œβ”€β”€ sends email via Resend
        └── writes ~/Library/Application Support/CalBridge/last-run.json

Environment Variables

Variable Description
GOOGLE_CLIENT_ID Google OAuth client ID (Desktop app type)
GOOGLE_CLIENT_SECRET Google OAuth client secret
GOOGLE_REFRESH_TOKEN Long-lived refresh token (from auth.ts or in-app setup)
NOTION_API_KEY Notion integration token
NOTION_PARENT_PAGE_ID ID of the parent Notion page
RESEND_API_KEY Resend API key for email notifications
RESEND_FROM Sender address once your domain is verified (default: onboarding@resend.dev)
PORT Backend port (default: 8420)

License

MIT

About

google calendar events to notion or obsidian

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors