@piyush_007/tweak-extension
v1.0.3
Published
Chrome Extension built with React, Vite, and TypeScript
Downloads
41
Readme
🧠 Tweak AI Prompts – Chrome Extension
Boost your productivity by injecting a ✨ Tweak button into AI input boxes (ChatGPT, Claude, Gemini, DeepSeek) that optimizes your prompts for better AI responses.
✨ Features
- Injects a "Tweak Prompt" button directly into supported AI chat UIs.
- Uses the OpenRouter API to optimize the written prompt.
- Works with:
- ChatGPT (
chat.openai.com) - Claude (
claude.ai) - Gemini (
gemini.google.com) - DeepSeek (
chat.deepseek.com)
- ChatGPT (
- Prompt output is returned as plain optimized text — no clutter.
🧩 How It Works
- On AI input boxes, a ✨ button appears once you start typing.
- When clicked, your prompt is sent to OpenRouter using the
deepseek-chatmodel. - You get back a smarter, more specific version of your prompt, which replaces the original input.
🚀 Installation (Dev)
- Clone this repo:
git clone https://github.com/yourname/tweak-extension.git cd tweak-extension - Create a .env file:
VITE_OPENROUTER_API_KEY=your_openrouter_api_key_here
VITE_BACKEND_URL=your_backend_url- Run the dev build:
npm install
npm run buildGo to chrome://extensions/, enable Developer Mode, click Load unpacked, and select the /dist folder.
🔧 Configuration Make sure to include your OpenRouter key in the .env file as:
VITE_OPENROUTER_API_KEY=your_key
VITE_BACKEND_URL=your_backend_urlYou can get one from https://openrouter.ai/
📁 Project Structure
@piyush_007/tweak-extension/
│── dist/
│ ├── assets
│ | ├──popup-Cb2gFt_V.css
│ ├── icon
│ | ├──icon128.png
│ ├── content.js
│ ├── icon.svg
│ ├── index.html
│ ├── manifest.json
│ ├── popup.js
│── eslint.config.js
│── package.json
│── README.md🛡️ Permissions This extension requires the following permissions:
activeTab – To access the current tab’s DOM
storage – To optionally store prompt count locally
🧠 Example API Call
const response = await axios.post("https://openrouter.ai/api/v1/chat/completions", {
model: "deepseek/deepseek-chat-v3-0324:free",
messages: [
{
role: "system",
content: "You are a prompt optimizer. ONLY return the improved prompt."
},
{
role: "user",
content: "Summarize this article with key insights."
}
]
}, {
headers: {
Authorization: `Bearer ${VITE_OPENROUTER_API_KEY}`,
"Content-Type": "application/json"
}
});❤️ Contributing Have ideas or want to add support for more models or AI tools? PRs and feedback are welcome!
📄 License MIT License. Use it, fork it, build your AI toolkit.
