KeyGenie

KeyGenie

A productivity-enhancing AI assistant that brings the power of AI directly to your fingertips.

KeyGenie is a powerful AI assistant designed to seamlessly integrate into your existing workflow. By leveraging OpenAI's advanced language models, including GPT-4, KeyGenie provides real-time AI assistance directly from your keyboard, without interrupting your tasks.

Installation Instructions

  1. Download the KeyGenie program using the link below.
  2. Extract the contents of the ZIP file to a folder on your computer.
  3. Navigate to the extracted folder and locate run.py.
  4. Double-click run.py to start the program. If you do not have Python installed, follow the on-screen prompts to install it.
  5. After Python and the necessary modules are installed, the KeyGenie system tray icon will appear.
  6. Right-click the icon in the system tray and open the settings to enter your OpenAI API key and customize your experience.

KeyGenie

KeyGenie Logo

License



Introduction

KeyGenie is a powerful AI assistant designed to seamlessly integrate into your existing workflow. By leveraging OpenAI's advanced language models, including GPT-4, KeyGenie provides real-time AI assistance directly from your keyboard, without interrupting your tasks.


Features


Installation

Prerequisites

To check if Python is installed:

python --version

If Python is not installed, download it from Python's official website.

First-Time Setup

  1. Clone or Download the Repository:

    • Clone via Git:

      git clone https://github.com/yourusername/KeyGenie.git
      
    • Download ZIP:

      • Click on the Code button on the GitHub repository page.
      • Select Download ZIP.
      • Extract the ZIP file to your desired location.
  2. Navigate to the Project Directory:

    cd KeyGenie
    
  3. Run the Application:

    • Option 1: Double-click run.py.
    • Option 2: Run from the command line:

      python run.py
      
  4. Automatic Dependency Installation:

    • On the first run, KeyGenie will automatically install all necessary Python modules.
    • A file named first_run.txt will be created inside the brain folder after setup is complete.
  5. Provide Your OpenAI API Key:

    • After running the application, find the KeyGenie icon in your system tray (near the clock).
    • Right-click the icon and select Open Settings.
    • Enter your OpenAI API key in the API Key field.
    • Click Save API Key.

    Note: You need a valid OpenAI API key to use this application. Sign up at OpenAI's website if you don't have one.


Usage

Activating KeyGenie

Keybinds

Customizing Settings


Advanced Configuration

Custom Instructions

Model Selection

Typing Speed

Text-to-Speech (TTS)

Auto-Start on System Boot


Detailed Features

Streamlined Workflow Integration

KeyGenie integrates into your existing workflow without interrupting your tasks. It operates in the background and can be summoned with simple key combinations, allowing you to maintain focus while getting AI assistance as needed.

Customizable and Flexible

Tailored to suit your preferences, KeyGenie offers a fully customizable experience. With adjustable keybinds, typing speed, AI model selection, and temperature settings, you have full control over how the AI behaves, ensuring it complements your working style.

Supports Long-Form Content Generation

Whether you're drafting emails, writing essays, or generating code, KeyGenie is capable of handling long-form content. It offers the ability to start and continue writing, providing suggestions or completing text seamlessly as you type.

Lightweight and Non-Intrusive

With its discreet system tray operation, KeyGenie stays out of your way until you need it. Unlike traditional AI tools that require you to switch to a separate interface or window, this tool works directly in any text field you're using.


Use Cases

Creative Writing and Content Generation

Use KeyGenie to generate ideas, write blog posts, or draft essays and reports. The ability to continue and refine your writing makes it a perfect companion for authors and content creators.

Productivity Enhancement

From email drafting to technical writing, KeyGenie can help automate and speed up repetitive tasks by generating text or providing suggestions, allowing you to work more efficiently.

Coding Assistance

Developers can use KeyGenie to generate code snippets, explain functions, or debug issues. The flexibility to switch between natural language and code makes it ideal for any programming environment.

Accessibility Support

With customizable text-to-speech, KeyGenie enhances accessibility for users with visual impairments or those who prefer to listen rather than read.


Folder Structure

KeyGenie/
β”œβ”€β”€ run.py
β”œβ”€β”€ instructions.txt
β”œβ”€β”€ brain/
β”‚   β”œβ”€β”€ backgroundai.py
β”‚   β”œβ”€β”€ defaultSettings.json
β”‚   β”œβ”€β”€ menu.py
β”‚   β”œβ”€β”€ setup.py
β”‚   β”œβ”€β”€ NotoSans-Medium.ttf
β”‚   β”œβ”€β”€ Rowdies-Regular.ttf
β”‚   β”œβ”€β”€ Ubuntu-Bold.ttf
β”‚   β”œβ”€β”€ write.ico
β”‚   └── write.png

Detailed Script Descriptions

run.py

The main launcher script that initiates the application. It handles:

def main():
    # Check if the script is already being run by pythonw.exe
    if "pythonw" not in sys.executable:
        relaunch_with_pythonw()

    if not os.path.exists(first_run_file):
        # First time running the script
        run_script('setup.py', use_pythonw=False)
        with open(first_run_file, 'w') as f:
            f.write("Setup completed")
        run_script('backgroundai.py', use_pythonw=True)
    else:
        run_script('backgroundai.py', use_pythonw=True)

backgroundai.py

The core application script that:

class SystemTrayIcon(QSystemTrayIcon):
    def __init__(self, app: QApplication):
        super().__init__(app)
        # Initialize tray icon and menu
        self.setContextMenu(self.menu)
        self.show()

Implements the settings window using PyQt5:

class SettingsWindow(QDialog):
    def __init__(self):
        super().__init__()
        # Initialize UI components
        self.init_ui()

setup.py

A script that runs on the first execution to:

def install_missing_modules():
    for module in required_modules:
        if importlib.util.find_spec(module) is None:
            subprocess.check_call([sys.executable, "-m", "pip", "install", module])

Troubleshooting

Application Doesn't Start

Cannot Find KeyGenie Icon

Permission Issues

Modules Not Installed

Typing or TTS Doesn't Stop


Known Issues


FAQs

Do I need an OpenAI API key?

Yes, you need a valid OpenAI API key to use KeyGenie. You can obtain one by signing up at OpenAI's website.

Can I use KeyGenie on macOS or Linux?

Currently, KeyGenie is designed for Windows. Compatibility with macOS or Linux is not guaranteed.

How do I stop the AI from typing or speaking?

Press any key on your keyboard to interrupt the AI's typing or text-to-speech.

Where is my API key stored?

Your API key is stored locally in your user directory under privateVariables/apikey.txt.

Can I contribute to KeyGenie?

Yes! Contributions are welcome. Please see the Contributing section.


Contributing

To contribute:

  1. Fork the Project

    Click the Fork button at the top-right corner of the repository page.

  2. Create Your Feature Branch

    git checkout -b feature/AmazingFeature
    
  3. Commit Your Changes

    git commit -m 'Add some AmazingFeature'
    
  4. Push to the Branch

    git push origin feature/AmazingFeature
    
  5. Open a Pull Request


License

This project is licensed under the MIT License - see the LICENSE file for details.


Acknowledgments


Contact

For support or inquiries, join our Discord server:

Join Discord

Thank you for using KeyGenie! We hope it enhances your productivity and brings the power of AI directly to your fingertips.