Open-source Chrome extension that drafts AI replies on X / Twitter in your own voice, with personas, multilingual support, and your own OpenAI key. No subscription. No backend. Your key, your data.
- I was in Bangkok, my Thai was bad, and X's auto-translate would either break the page or render slang as nonsense. I wanted to read the timeline and reply like a human, not like Google Translate having a stroke. So TweAI started as a personal translator with persona-aware replies — long before X shipped the neural one.
Personas, flirt mode, deep author context, the careful work on prompt-injection defence — all of that is here because the original use case was actual human conversation across a language gap, not "scaling thought leadership." The extension was always for one person; it's just open-source now in case you have the same problem.
- ✍️ AI Reply with personas — 5 built-in tech-creator personas (Founder, Engineer, Researcher, Casual, Flirt) plus your own custom personas with arbitrary system prompts.
- 🪪 Per-account memory — different default persona depending on which X account is active in the tab.
- 🤖 Explain any tweet — 2–3 bullet summary: gist, tone, context.
- 🌐 Auto-translate the timeline — lazy via IntersectionObserver, cached locally so you never re-translate the same tweet.
- 🎯 Deep context — optionally include the author's last 5 tweets so the reply matches their thread.
- 💬 DM composer — same prompt + Tweet flow for direct messages.
- 💸 Token budget — daily soft-limit on input + output tokens; blocks API calls when exceeded.
- 🩺 Diagnostics — one-click health check verifies key, provider connectivity, and that X DOM selectors still match.
- 🔑 BYOK — your OpenAI (or Google Translate) key, stored locally. Nothing transits a server we control.
- 🌍 Multilingual — UI labels in English/Russian; replies in any of 12 languages or matching the source tweet.
git clone https://github.com/froggychips/tweai.git- Open
chrome://extensions - Enable Developer mode (top-right)
- Click Load unpacked and select the
TweAIdirectory
Coming soon. The extension is currently in beta — install from source above.
- After loading the extension, click its icon → Options.
- Paste your OpenAI API key (
sk-...). Get one at platform.openai.com. - Optionally:
- Set a default persona (Tech Founder, Engineer, AI Researcher, Casual Tech, Flirt).
- Pick a default reply language (or
autoto match your browser). - Switch translation provider to Google Translate API if you have a key (cheaper for high-volume timeline translation).
- Click Test API Key to verify, then Save.
| Trigger | What it does |
|---|---|
Open x.com or twitter.com |
Auto-translates each tweet as it scrolls into view (toggleable in options) |
| Click 🤖 Explain under any tweet | Renders a 2–3 bullet AI analysis |
| Click AI Reply with style + persona | Generates a draft reply matching the chosen voice |
| Toggle Deep before AI Reply | Includes the author's recent tweets as context |
| Click ✍️, type a prompt, press Enter | Sends a custom prompt to the AI for a tailored draft |
| Click Tweet | Translates the draft into the source tweet's language, opens the native reply box, inserts the text |
| Permission | What it's actually for |
|---|---|
storage |
Save your API key, preferences, custom personas, per-account rules. |
scripting, activeTab |
Inject the in-page UI (buttons, submenu, composer). |
webNavigation |
Detect SPA navigation on x.com so the UI survives client-side routing. |
clipboardWrite |
The Tweet button's clipboard fallback when the native composer isn't available. |
host_permissions |
api.openai.com, x.com, twitter.com. |
TweAI is bring-your-own-key. There is no backend. Your API key, your prompts, and the AI responses never pass through any server we control. See PRIVACY.md for the full breakdown.
The extension wraps tweet text in delimiters and explicitly instructs the model to treat it as data, not instructions, defending against the most common prompt-injection attacks. To report a vulnerability, open a private security advisory. See SECURITY.md.
- Personas (Tech creator preset)
- BYOK + privacy-first
- Prompt-injection hardening
- Custom persona editor (write your own system prompt)
- Per-account persona memory (different voice on different X accounts)
- Token-budget and daily limits in Options
- Health-check (verify selectors and provider connectivity)
- Chrome Web Store publication
- Cloud-tier (24/7 monitoring, lead-gen pipeline) — for B2B; explicitly opt-in
npm install
npm run lint
npm run format
npm run package # → dist/ + tweai-v<version>.ziptools/build.mjs builds the CWS-ready zip with the right inclusions (no tweai-mcp-server/, no docs/). The same script runs in .github/workflows/release.yml — pushing a v* tag uploads a GitHub release with the zip attached automatically.
CWS submission checklist: docs/CWS_REVIEW.md. Launch-day copy: docs/LAUNCH.md. Demo GIF: docs/RECORDING.md.
See CONTRIBUTING.md for project layout, local dev, and PR conventions. Architecture overview lives in docs/ARCHITECTURE.md. If something on x.com stops working, start with docs/TROUBLESHOOTING.md.
The project has zero runtime dependencies. Source is plain MV3 JavaScript; only eslint and prettier ship as dev-deps.
- GitHub Issues: https://github.com/froggychips/tweai/issues
- Telegram: @froggychips
Apache 2.0 — see LICENSE.
