Skip to content

KRMed/Calighter

Repository files navigation


Highlight text anywhere → Instantly add it to Google Calendar with local NLP!




🚀 Overview

Calighter is a Chrome extension that lets you highlight any text on the web and instantly add it to your Google Calendar as an event. It uses a local AI model for smart date/time extraction and event generation—no data leaves your machine.

  • Local AI: All language processing runs locally for privacy.
  • Fast & Simple: Highlight → Click → Calendar event.
  • Customizable: Tweak your event details even after highlighting!

🔑 Features

  • Highlight → One-click event creation
  • Local AI model to extract Event / Time / Location
  • Natural language date parsing (AI + chrono-node date/time parsing)
  • Google Calendar integration with calendar selection and event posting
  • Editable event fields (title, start/end time, location, description)
  • Side panel + popup support (Manifest V3)
  • Fully local inference (no external server for text processing)

🛡️ Permissions & Privacy

Calighter only requests the permissions it needs to parse highlights locally and create calendar events.

Tip: If you don’t need a persistent content script, you can rely on activeTab + scripting.executeScript and drop blanket host permissions.

API / Permission / Scope Why It’s Needed Notes
identity Google OAuth sign-in Used only to request Calendar scopes
storage Cache model + user prefs Stores model artifacts and lightweight state locally
activeTab / scripting Inject (or message) content script on demand Reads current selection when popup is active
sidePanel Preferred how it looked over typical extension Requires Chrome 114+; set via "side_panel" in manifest
(Optional) Host Permissions (https://*/*, http://*/*) For persistent content script injection Prefer activeTab if possible
Scopes: calendar.readonly, calendar.events Read calendars + create events Only data you submit is sent to Google

Privacy:

  • Parsing runs locally in the browser (ONNX Runtime and WebAssembly).
  • No third-party servers; no analytics or telemetry; no data stored outside of Chrome.
  • Only the event payload you confirm is sent to Google Calendar.

🤖 AI Model

  • Base Model: microsoft/MiniLM-L12-H384-uncased
    • FP32 checkpoint size: 134 MB
  • Current Model: Calighter Model (fine‑tuned for EVENT / TIME / LOCATION)
    • INT8: 33.8 MB (75% size reduction vs FP32)
    • F1 Accuracy: 90%
  • Inference: Runs client-side (WebAssembly backend). Model weights fetched once and cached.

🏁 Quick Start (Unpacked User Install)

  1. Clone repository
    git clone https://github.com/KRMed/Calighter.git
    cd Calighter
  2. Install dependencies
    npm install
  3. Build (generates dist with manifest & assets)
    npm run build
  4. Open chrome://extensions → Enable Developer Mode → “Load unpacked” → select the dist folder.
  5. Click the extension icon → Sign in with Google → Highlight text on any page.

🚧 Chrome Web Store publication in progress 🚧


🧑‍💻 Developer Setup (OAuth + Watch Mode)

Prereqs: Node 18+, Chrome 114+, Google account.

  1. Clone & install
    git clone https://github.com/KRMed/Calighter.git
    cd Calighter
    npm install
  2. (Optional if you want your own credentials) Create Google OAuth credentials
    • Google Cloud Console → create/select a project
    • Enable “Google Calendar API” (APIs & Services → Library)
    • Create OAuth 2.0 Client ID (Web application)
    • Add Authorized redirect URI:
      https://<EXTENSION_ID>.chromiumapp.org/
      
    • How to get <EXTENSION_ID>: temporarily load the extension once (step 4) → copy the ID from chrome://extensions.
  3. (If customizing OAuth) Update manifest.json oauth2.client_id with your Client ID.

    If you choose an env-based approach, expose VITE_GOOGLE_CLIENT_ID and reference it in your OAuth helper code.

  4. Run in watch mode
    npm run dev
    Then load (or reload) the dist/ folder via chrome://extensions.
  5. Sign in & test
    • Open the popup → Sign in with Google
    • Highlight text → reopen popup → confirm fields → “Add to Calendar”
  6. Iterate
    • Keep npm run dev running
    • After rebuilds: click “Reload” on the Calighter card in chrome://extensions
  7. Debugging
    • Service worker logs: chrome://extensions → “Service worker” link under Calighter
    • Content script logs: page DevTools Console
    • Popup logs: Right-click popup → Inspect
  8. Scopes requested
    https://www.googleapis.com/auth/calendar.readonly
    https://www.googleapis.com/auth/calendar.events
    
  9. Notes
    • Add a "key" to manifest.json to stabilize the extension ID across rebuilds (optional).
    • Parsing is local (ONNX Runtime). Only confirmed event data is sent to Google.

(Optional) Alternate Minimal Permissions Strategy

If you remove blanket host permissions:

  • Drop host_permissions
  • Use activeTab + chrome.scripting.executeScript (or message existing content script only after user action)
  • Reduces permission prompt footprint

About

Chrome extension that takes in highlighted input and add's it to google calendar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors