Your browser. Your agent.
TabPilot is a free, open-source Chrome extension that uses local AI (Gemini Nano) to plan and execute tab actions—no cloud, no fees, no data sharing. Boost your productivity and privacy with AI-powered tab automation, right in your browser.
- Prompt-driven tab automation (
openTab,closeTab,switchTab,navigateTo,clickElement,fillForm,getPageContent,groupTabs,waitMs) - Multi-provider AI support: Chrome Gemini Nano, OpenAI, Anthropic, Google Gemini
- Streaming status updates from worker to sidepanel
- Chat persistence and retry/new-chat UX
- Recent Chats tab with persisted multi-chat listing and switching
- Prompt rephrasing UX:
✨ Rephrasein chat input (rewrite before sending)✨ Rephrase & Runon previous user turns (rewrite + execute)
- Save and run routines
- Extension-side memory across chats, with LRU behavior (capacity 50)
- Memories are injected into planning prompts
- Recency is refreshed on injection and manual access
- Conversation history is sent with prompts for better multi-turn context routing
- Dev mode via CRXJS + Vite
npm run dev: Start CRXJS/Vite dev server (hot reload)npm run build: Type-check + production build todist/npm run lint: Run ESLintnpm test: Run Playwright tests
- Install Node.js 22.x (required):
# if you use nvm
nvm install 22
nvm use 22- Install dependencies:
npm install- Start dev server:
npm run dev- In Chrome:
- Open
chrome://extensions - Enable Developer mode
- Load unpacked extension from this project (or CRXJS-generated output, depending on your dev flow)
- This repo enforces
Node 22.12+duringnpm install. - If install fails with a Node version message, switch to Node 22 and re-run
npm install.
When a task appears to stop early or return incomplete output, inspect these first:
- Service worker logs (primary runtime source)
chrome://extensions-> TabPilot ->Service worker->Inspect- This shows worker-side errors and message flow.
- Sidepanel logs (UI message handling)
- Open the extension sidepanel
- Right-click inside panel ->
Inspect - Check Console for incoming message handling issues.
- In-panel execution trace
ACTION_PROGRESS,TASK_COMPLETE, andTASK_ERRORare reflected in the action log/status UI.
The app now emits structured logs with consistent prefixes:
[TAP][worker]in service worker DevTools (message routing, task lifecycle, errors)[TAP][ai]in service worker DevTools (provider selection, OpenAI fallback, normalization)[TAP][executor]in service worker DevTools (action start/done/error, remap, load waits)[TAP][sidepanel]in sidepanel DevTools (port connect/disconnect, sent/received messages)
Each module currently uses a local constant named DEBUG_LOGS.
- Logs are disabled by default for production safety. Set
DEBUG_LOGS = truein these files only for local debugging:src/background/worker.tssrc/background/ai.tssrc/background/executor.tssrc/sidepanel/hooks/useChromeMessages.ts
The worker uses safe message posting to avoid noisy unhandled errors when the sidepanel disconnects (for example panel close, extension reload, or HMR).
- If a port is disconnected, worker messages are dropped safely.
- In-flight tasks are aborted on disconnect.
After actions execute, any captured page content is summarized and sent back as an assistant follow-up message.
- Action execution still appears in the action log.
- A separate assistant message provides a readable summary.
Memories are stored in chrome.storage.local and shown in the Memory view.
- Storage key:
agent_memories - Capacity:
50 - Eviction policy: least recently used (LRU)
lastAccessedAtis refreshed when:- a memory is injected into prompt context
- the user manually touches a memory card in the Memory view
This keeps long-lived preferences while automatically pruning stale items.
The sidepanel supports two rephrase entry points:
- Input-level rephrase (
✨ Rephrase): rewrites current input and immediately runs the rewritten prompt. - History-level rephrase (
✨ Rephrase & Run): rewrites the last user prompt in chat history and re-runs it.
Protocol path:
- Sidepanel sends
REPHRASE_PROMPT - Worker calls provider-aware
rephraseUserPrompt(...) - Worker returns
REPHRASED_PROMPT - Sidepanel starts a fresh execution using the rewritten prompt
EXECUTE_PROMPT now includes prior chat turns (history) so model calls can use recent user/assistant context. This improves follow-up interpretation and reduces misrouting in multi-turn tasks.
Use the Recent Chats top-level tab in the sidepanel to browse and switch among saved conversations.
- The list shows a human-friendly chat title (first user prompt snippet), message count, and recency metadata.
- Selecting a chat restores its full message history into the Chat view.
- New chat creates a fresh thread without deleting prior chats.
- Legacy single-thread storage (
chat_history) is migrated into the multi-thread store on load. - Storage key:
chat_threads_state_v1 - Recency list capacity:
20chats (most recently updated kept) - Per-chat message cap:
100messages
Playwright coverage in tests/e2e/extension.spec.ts includes:
- extension service worker + sidepanel smoke
- settings persistence
- view toggles (Chat / Recent Chats / Routines / Memory)
- routines validation/import/persistence flow
- memory add/persist/delete flow
- rephrase visibility/trigger flow
- recent chat listing + switching persistence across reload
Current suite status: 6 passed.
System design notes are documented in docs/guides/architecture.md.
- CRXJS may show a warning about rollup/rolldown options during build; this is typically non-blocking.
- If Playwright tests fail due to missing browser binaries, run:
npx playwright install chromium- If extension E2E tests fail in a restricted/sandboxed shell with Chromium profile or ProcessSingleton
errors, run
npm testin a normal local terminal session.
- License: MIT (see LICENSE)
- Contribution guide: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security policy: SECURITY.md
- Privacy policy: PRIVACY.md
- Support policy: SUPPORT.md
- Changelog strategy: CHANGELOG.md (Semantic Versioning)
- External providers (OpenAI, Anthropic, Gemini API) receive prompts and selected execution context.
- Sensitive provider settings are stored in extension local storage.
- Default runtime logs are disabled for production safety.
- Report vulnerabilities privately using SECURITY.md.
- v1 support target is Chrome only; Safari packaging is out of scope for initial release.
- For native GUI automation validation workflows, keep the browser window in the active macOS space. Cross-space visibility and focus can vary and should not be used as a deterministic CI gate.
- Recommended automation workflow for interactive UI checks: snapshot state, apply one action, re-snapshot and verify.
- CI workflow runs format, lint, build, and tests.
- Tag a release with vX.Y.Z to trigger GitHub release packaging.
- Use CHANGELOG.md and Semantic Versioning for release notes.
TabPilot is open source to empower users with transparency, privacy, and control. By making the code public, we:
- Enable community-driven innovation
- Build trust—no hidden data collection
- Let anyone audit, contribute, or extend the project
- Keep the core experience free for everyone
We welcome contributions of all kinds! You can:
- Suggest features or report bugs via GitHub Issues
- Join discussions and share ideas in GitHub Discussions
- Submit pull requests for code, docs, or tests
- Help with translations, design, or outreach
See CONTRIBUTING.md for details.
- Project Home: https://github.com/agarwalshashwat/TabPilot
- GitHub Discussions: TabPilot Discussions
- Sponsor: GitHub Sponsors
- Contact: Open an issue or join the discussion!
