A minimalist Windows utility for rewriting selected text on-the-fly using the OpenRouter API, triggered by a global hotkey.
- Global Hotkey: Select text anywhere and press
Ctrl+Shift+Qto activate the rewrite window. - Custom Prompts: Define and save reusable rewrite prompts (e.g., "Fix Grammar," "Make Professional").
- Dynamic Instructions: Type custom rewrite instructions for one-off tasks.
- Automatic Paste: The rewritten text is automatically copied to the clipboard and pasted back, replacing the original selection.
- Modern UI: A clean, modern interface built with CustomTkinter.
- Python 3.8+
- An OpenRouter API key
-
Clone the repository:
git clone https://github.com/your-username/your-repository-name.git cd your-repository-name -
Install dependencies:
pip install -r requirements.txt
-
Configure API Key:
- Run the application once (
python quick_rewriter.py). It will generate aconfig.jsonfile. - Open
config.jsonand replace"YOUR_OPENROUTER_API_KEY_HERE"with your actual OpenRouter API key. - Alternatively, launch the app and open the settings (⚙️) to add your key via the UI.
- Run the application once (
To run the application directly from the source code:
python quick_rewriter.pyThe application will run in the background, listening for the hotkey.
- Select any text in any application.
- Press
Ctrl+Shift+Q. - In the popup window:
- Type a custom instruction (e.g., "Summarize this in one sentence") and press
Enter. - Or, type
/to select from a list of pre-configured quick prompts.
- Type a custom instruction (e.g., "Summarize this in one sentence") and press
- The rewritten text will automatically replace your selection.
To compile the application into a standalone Windows executable and create an installer, run the compile.bat script. This requires Inno Setup 6 to be installed.
./compile.batThe final installer will be located in the Output/ directory.
This application is a single-file Python script using customtkinter for the GUI, pynput for global hotkey management, and the requests library to interact with the OpenRouter API.