A powerful tool for creating custom AI-powered shortcuts using OpenAI's API. This application allows you to bind keyboard shortcuts to specific AI prompts and actions.
- 🔌 OpenAI API integration
- ⌨️ Custom keyboard shortcuts
- 📝 Customizable prompts
- 📋 Clipboard integration
- 📦 Environment variable support
- Clone the repository:
git clone https://github.com/fxyzbtc/pyaishortcuts.git
cd pyaishortcuts- Install dependencies:
pip install -r requirements.txtor
uv pip install -r requirements.txt- Create a
.envfile:
touch .env- Add your OpenAI API key to
.env:
API_ENDPOINT=https://api.sambanova.ai/v1
API_KEY=xxxxxxxx
MODEL=DeepSeek-R1-Distill-Llama-70BThe config.json file allows you to customize prompts and keyboard shortcuts. Here's how to modify it:
- Open
config.jsonin your preferred text editor:
code config.json- Add a new shortcut:
{
"key_binding": {
"shortcut": "ctrl+shift+a"
},
"shortcuts": {
"my_custom_prompt": {
"name": "My Custom Prompt",
"default_prompt": "You are a helpful assistant...",
"parameters": {
"temperature": 0.7,
"max_tokens": 500
}
}
}
}- Save and close the file.
- Open
.envin your text editor:
code .env- Add your OpenAI API key and endpoint:
API_ENDPOINT=https://api.sambanova.ai/v1
API_KEY=xxxx
MODEL=DeepSeek-R1-Distill-Llama-70B- Save and close the file.
- Run the application:
# by source code
python main.py
# by package name
python -m pyaishortcuts
# by exe
pyaishortcuts- Use your keyboard shortcut to trigger the AI action.
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On macOS/Linux
# or
.venv\Scripts\activate # On Windows- Install development dependencies:
pip install -r requirements-dev.txtThis project uses:
blackfor code formattingisortfor import sortingflake8for linting
Run the following commands to format and lint your code:
black .
isort .
flake8 .- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name- Commit your changes:
git commit -m "Add your feature description"- Push to the branch:
git push origin feature/your-feature-name- Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
- 📫 Report issues on GitHub Issues
- 💬 Ask questions or discuss ideas in the project's discussion forum (if available)
Made with ❤️ using Python
