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.
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.
To check if Python is installed:
python --version
If Python is not installed, download it from Python's official website.
Clone or Download the Repository:
Clone via Git:
git clone https://github.com/yourusername/KeyGenie.git
Download ZIP:
Navigate to the Project Directory:
cd KeyGenie
Run the Application:
run.py
.Option 2: Run from the command line:
python run.py
Automatic Dependency Installation:
first_run.txt
will be created inside the brain
folder after setup is complete.Provide Your OpenAI 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.
Prompt Mode:
Right Shift
) to start capturing your input.Completion Mode:
Right Ctrl
) to start capturing text to be completed.Stopping the AI Typing or TTS:
Default Keybinds:
Right Shift
Right Ctrl
Customizing Keybinds:
Model Selection:
Custom Instructions:
Additional Settings:
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.
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.
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.
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 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.
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.
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.
With customizable text-to-speech, KeyGenie enhances accessibility for users with visual impairments or those who prefer to listen rather than read.
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
The main launcher script that initiates the application. It handles:
First-Time Setup:
setup.py
to install dependencies and create necessary files.Relaunching with pythonw.exe:
pythonw.exe
to run without a console window.Starting backgroundai.py:
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)
The core application script that:
Listens for Keyboard Events:
Interacts with OpenAI's API:
Manages System Tray Icon and Settings Menu:
Handles Text-to-Speech and Auto-Typing:
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:
API Key Input:
Customizable Settings:
Startup Management:
class SettingsWindow(QDialog):
def __init__(self):
super().__init__()
# Initialize UI components
self.init_ui()
A script that runs on the first execution to:
Install Required Python Modules:
Create Shortcuts:
Ensure Dependencies are Correctly Set Up:
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])
Ensure Python 3 is Installed:
python --version
in the command prompt.Check Dependencies:
If not, manually install them:
pip install keyboard openai pyqt5 pywin32
Compatibility:
API Key Storage:
privateVariables
.Yes, you need a valid OpenAI API key to use KeyGenie. You can obtain one by signing up at OpenAI's website.
Currently, KeyGenie is designed for Windows. Compatibility with macOS or Linux is not guaranteed.
Press any key on your keyboard to interrupt the AI's typing or text-to-speech.
Your API key is stored locally in your user directory under privateVariables/apikey.txt
.
Yes! Contributions are welcome. Please see the Contributing section.
To contribute:
Fork the Project
Click the Fork button at the top-right corner of the repository page.
Create Your Feature Branch
git checkout -b feature/AmazingFeature
Commit Your Changes
git commit -m 'Add some AmazingFeature'
Push to the Branch
git push origin feature/AmazingFeature
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support or inquiries, join our Discord server:
Join DiscordThank you for using KeyGenie! We hope it enhances your productivity and brings the power of AI directly to your fingertips.