Skip to content

umairhex/ai-text-revisor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Text Revisor

A minimalistic OS-level text revision tool powered by AI. It runs in the system tray/background, and when triggered by a custom keyboard shortcut, it reads the selected text, securely routes it through Litellm (supporting OpenAI, Anthropic, Gemini, OpenRouter), and instantly replaces the text with grammatically corrected output. Includes a slick overlay toast notification for processing status.

Prerequisites

  1. Python 3.10+: Ensure Python is installed and added to your system PATH.
  2. Git: For cloning the repository.

Setup Instructions

Follow these steps to set up the development environment from scratch:

1. Clone the repository

git clone <your-repo-url>
cd ai-text-revisor

2. Create a virtual environment It's highly recommended to use a virtual environment to manage dependencies locally.

python -m venv venv

3. Activate the virtual environment

  • Windows (PowerShell): .\venv\Scripts\Activate.ps1
  • Windows (CMD): .\venv\Scripts\activate.bat
  • Mac/Linux: source venv/bin/activate

4. Install requirements Install all required packages needed for the application and compilation:

pip install customtkinter keyboard pyperclip litellm requests python-dotenv keyring pyinstaller

Running Locally

Once everything is installed and the virtual environment is activated, you can run the app locally:

python main.py

How to Build the Standalone .exe

To package the application into a single executable file that can run without installing Python, we use PyInstaller. Since litellm and tiktoken require specific metadata and dynamically loaded encodings, a custom build command is necessary.

Ensure your virtual environment is active before running this command.

Run the following command from the project root (ai-text-revisor folder):

python -m PyInstaller --clean --noconfirm --noconsole --onefile `
  --collect-all customtkinter `
  --collect-all litellm `
  --collect-all tiktoken `
  --copy-metadata tiktoken `
  --hidden-import=tiktoken_ext.openai_public `
  --hidden-import=tiktoken_ext `
  --hidden-import=keyring.backends.Windows `
  --hidden-import=keyring.backends `
  --name "AI Text Revisor" `
  main.py

Explanation of Build Flags:

  • --clean: Cleans PyInstaller cache and removes temporary files.
  • --noconfirm: Replaces the output directory without asking.
  • --noconsole: Hides the command prompt window behind the app GUI.
  • --onefile: Bundles everything into a single .exe file.
  • --collect-all: Essential for large UI frameworks (customtkinter) and dynamic libraries (litellm, tiktoken) which load assets/data files behind the scenes.
  • --copy-metadata: Required specifically by tiktoken so it can find its package info at runtime.
  • --hidden-import: Forcibly includes modules that PyInstaller cannot statically detect during its analysis step (like tiktoken encodings and Windows keyring storage modules).

Post-Build:

After execution finishes, your standalone application will be located at: dist/AI Text Revisor.exe

About

An OS-level, AI-powered text revisor that runs in the background. Select text anywhere, press a hotkey, and instantly improve grammar and clarity using your choice of LLM (OpenAI, Anthropic, Gemini, OpenRouter).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors