A Chrome extension that transforms text into different work-appropriate styles using Google Gemini 2.0. The extension provides a clean, intuitive interface for rewriting text in various professional tones.
This Chrome extension allows you to take any text you select or type, then send it to Google Gemini (or another LLM) to transform it into different writing styles. Whether you need to make your message more professional, diplomatic, motivational, or any other work-appropriate tone, this tool helps you communicate more effectively.
Key Features:
- Text Input: Type or paste any text you want to transform
- AI-Powered: Uses Google Gemini 2.0 to intelligently rewrite your text
- Multiple Styles: Choose from 7 different professional writing styles
- Instant Results: Get transformed text in seconds
- Easy Copy: Copy the results directly to your clipboard
- 7 Professional Styles: Transform text into different work-appropriate tones
- Real-time Processing: Uses Google Gemini 2.0 for high-quality text transformation
- Clean UI: Modern, responsive popup interface
- Copy to Clipboard: Easy copying of transformed text
- Persistent Storage: Saves your input and output text between sessions
- Keyboard Shortcuts: Quick access with Ctrl/Cmd + Enter
- Professional / Formal – Clear, concise, businesslike
- Conciliatory / Diplomatic – Smooths over disagreements or sensitive topics
- Encouraging / Motivational – Uplifts or motivates the reader
- Appreciative / Grateful – Expresses thanks or recognition
- Confident / Assertive – Strong and clear messaging without being rude
- Simplified / Layman-friendly – Makes complex concepts easy to understand
- Polished / Executive-ready – Suitable for leadership-level communication
Text-Style-Transformer/
├── chrome-extension/
│ ├── manifest.json # Chrome extension manifest (V3)
│ ├── popup.html # Extension popup interface
│ ├── popup.css # Styling for the popup
│ ├── popup.js # JavaScript functionality
│ └── icons/ # Extension icons (optional)
├── backend/
│ ├── app.py # Flask API server
│ ├── requirements.txt # Python dependencies
│ └── env.example # Environment variables template
├── .venv/
│ └── .env # API key configuration (create this)
└── README.md # This file
You MUST start the backend server before loading the Chrome extension. The extension will not work without the backend running.
-
Install Python Dependencies:
cd backend pip install -r requirements.txt -
Get Google Gemini API Key:
- Visit Google AI Studio
- Create a new API key
- Copy the API key
-
Configure Environment Variables:
# Create the .venv directory if it doesn't exist mkdir -p .venv # Create the .env file echo "GEMINI_API_KEY=your_actual_api_key_here" > .venv/.env
Or manually create
.venv/.envwith:GEMINI_API_KEY=your_actual_api_key_here -
Start the Backend Server (REQUIRED):
# Activate virtual environment and start server source .venv/bin/activate cd backend python app.py
The server will start on
http://localhost:8000Keep this terminal window open! The server must stay running for the extension to work.
-
Load the Extension:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
chrome-extensionfolder
- Open Chrome and go to
-
Pin the Extension (optional):
- Click the puzzle piece icon in Chrome toolbar
- Pin "Text Style Transformer" for easy access
-
Open the Extension:
- Click the extension icon in your Chrome toolbar
- The popup will open
-
Transform Text:
- Type or paste any text you want to transform in the input textarea
- Click one of the 7 style buttons (Professional, Diplomatic, Motivational, etc.)
- Wait for the transformation (loading indicator will show)
- Copy the result using the "Copy Result" button
-
How It Works:
- Your text is sent to Google Gemini 2.0 AI
- The AI rewrites your text in the selected professional style
- The transformed text appears in the output area
- You can copy it and use it anywhere
-
Keyboard Shortcuts:
Ctrl/Cmd + Enter: Transform with Professional styleEscape: Clear all text
The backend provides the following endpoints:
GET /health- Health checkPOST /transform- Transform text with specified styleGET /styles- Get available transformation styles
{
"text": "Your text to transform",
"style": "professional",
"styleDescription": "Professional / Formal – Clear, concise, businesslike"
}{
"transformedText": "Transformed text result",
"originalText": "Your original text",
"style": "professional",
"success": true
}The Flask backend uses:
- Flask: Web framework
- Flask-CORS: Cross-origin resource sharing
- google-generativeai: Google Gemini API client
- python-dotenv: Environment variable management
The Chrome extension uses:
- Manifest V3: Latest Chrome extension format
- Vanilla JavaScript: No external dependencies
- Modern CSS: Responsive design with gradients and animations
- Chrome Storage API: Persistent data storage
-
Test Backend:
curl -X POST http://localhost:5000/transform \ -H "Content-Type: application/json" \ -d '{"text": "Hello world", "style": "professional"}'
-
Test Extension:
- Load the extension in Chrome
- Open the popup and test each style button
- Verify text transformation works correctly
-
"Failed to transform text" Error:
- Check if the backend server is running on
http://localhost:8000 - Verify your Gemini API key is correct in
.venv/.env - Check browser console for detailed error messages
- Make sure you started the backend with:
source .venv/bin/activate && cd backend && python app.py
- Check if the backend server is running on
-
Extension Not Loading:
- Ensure you're using Chrome (not other browsers)
- Check that Developer mode is enabled
- Verify the manifest.json file is valid
-
CORS Errors:
- Make sure Flask-CORS is installed and configured
- Check that the backend is running on port 8000 (not 5000)
-
API Key Issues:
- Verify the API key is set in the
.venv/.envfile - Check that the key has proper permissions for Gemini API
- Ensure no extra spaces or characters in the key
- Verify the API key is set in the
To enable debug logging in the backend:
app.run(debug=True, host='0.0.0.0', port=8000)- The API key is stored in environment variables (not in code)
- CORS is configured to allow requests from the Chrome extension
- Input validation is performed on all API endpoints
- Error messages don't expose sensitive information
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
For issues or questions:
- Check the troubleshooting section above
- Review the browser console for error messages
- Verify all setup steps were completed correctly
- Check that your Gemini API key is valid and has sufficient quota