DJJJNabba / KeyGenie

Really yes
MIT License
1 stars 0 forks source link

KeyGenie

KeyGenie Logo

License

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


Table of Contents


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()

menu.py

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:


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