Tabby-Grouper

Tabby Grouper

繁體中文版請見 README.md.

A Chrome MV3 extension that uses AI to automatically analyse and group tabs. Supports OpenRouter, OpenAI, and Google Gemini — call your model of choice (Claude, Gemini, GPT, etc.) — and clusters related tabs into the same Chrome tab group based only on tab title, hostname, and up to 80 characters of the URL path. Tab content is never read; query strings and URL fragments are never transmitted.

Features

Installation

Build from source

npm install
npm run build

The build emits the unpacked extension under dist/. Open chrome://extensions, enable Developer mode in the top-right corner, click Load unpacked, and pick the dist/ directory.

Package

npm run zip

Produces tabby-grouper.zip in the project root, ready for upload to the Chrome Web Store or for distribution.

Usage

  1. After installing, click the Tabby Grouper toolbar icon → “Open settings”
  2. Pick an AI provider, paste the matching API key (OpenRouter / OpenAI / Google AI Studio); the model name is optional
  3. Back in the popup, optionally type a filter instruction (max 512 chars) and press “Group tabs in current window”

Task memory and restore

Personalised memory (optional)

Development

npm run dev          # Vite dev mode
npm run type-check   # TypeScript type-check
npm run test         # Vitest unit tests
npm run gen:icons    # Regenerate icons in all sizes from the source image

Stack: Vite + @crxjs/vite-plugin + plain TypeScript, no UI framework.

Project structure

src/
├── background.ts         # Service worker: handle messages, call APIs, create groups, register tabGroups listeners
├── lib/
│   ├── openrouter.ts     # AI provider (OpenRouter / OpenAI / Gemini) calls and output validation
│   ├── grouping.ts       # Shared helpers: pickColor, isGroupableTab
│   ├── tasks.ts          # Task type, storage key constants, retention/capacity caps
│   ├── storage.ts        # chrome.storage.local reads/writes, CAS lock, lazy prune
│   ├── groupSync.ts      # group↔task map rebuild, pendingResume detection, name/color sync
│   ├── resume.ts         # Task restore algorithm
│   ├── userPrefs.ts      # Personalised memory: sample collection + LLM distillation (gated by opt-in flag)
│   ├── messages.ts       # background ↔ popup message types (discriminated union)
│   ├── *.test.ts         # Vitest unit tests
├── popup/                # Toolbar popup UI (Group / Tasks views)
└── options/              # Options page (API key, model, dragged-tab policies, personalised memory)

Limits and security

Changelog

See CHANGELOG.md.

Privacy

See PRIVACY.md. In short: