Skip to main content

lightweight/neat shortcuts to access llm for daily does, like email assistance, translation

Project description

AI Shortcuts

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.

AI Shortcuts Screenshot

Features

  • 🔌 OpenAI API integration
  • ⌨️ Custom keyboard shortcuts
  • 📝 Customizable prompts
  • 📋 Clipboard integration
  • 📦 Environment variable support

Installation

  1. Clone the repository:
git clone https://github.com/fxyzbtc/pyaishortcuts.git
cd pyaishortcuts
  1. Install dependencies:
pip install -r requirements.txt

or

uv pip install -r requirements.txt
  1. Create a .env file:
touch .env
  1. Add your OpenAI API key to .env:
API_ENDPOINT=https://api.sambanova.ai/v1
API_KEY=xxxxxxxx
MODEL=DeepSeek-R1-Distill-Llama-70B

Configuration

Configuring config.json

The config.json file allows you to customize prompts and keyboard shortcuts. Here's how to modify it:

  1. Open config.json in your preferred text editor:
code config.json
  1. 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
      }
    }
  }
}
  1. Save and close the file.

Configuring .env

  1. Open .env in your text editor:
code .env
  1. Add your OpenAI API key and endpoint:
API_ENDPOINT=https://api.sambanova.ai/v1
API_KEY=xxxx
MODEL=DeepSeek-R1-Distill-Llama-70B
  1. Save and close the file.

Usage

  1. Run the application:
# by source code
python main.py

# by package name
python -m pyaishortcuts

# by exe
pyaishortcuts
  1. Use your keyboard shortcut to trigger the AI action.

Development

Setting up the Development Environment

  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On macOS/Linux
# or
.venv\Scripts\activate  # On Windows
  1. Install development dependencies:
pip install -r requirements-dev.txt

Code Style

This project uses:

  • black for code formatting
  • isort for import sorting
  • flake8 for linting

Run the following commands to format and lint your code:

black .
isort .
flake8 .

Contributing

  1. Fork the repository
  2. Create a new branch:
git checkout -b feature/your-feature-name
  1. Commit your changes:
git commit -m "Add your feature description"
  1. Push to the branch:
git push origin feature/your-feature-name
  1. Open a Pull Request

License

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

Support

  • 📫 Report issues on GitHub Issues
  • 💬 Ask questions or discuss ideas in the project's discussion forum (if available)

Made with ❤️ using Python

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaishortcuts-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaishortcuts-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pyaishortcuts-0.1.0.tar.gz.

File metadata

  • Download URL: pyaishortcuts-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.25

File hashes

Hashes for pyaishortcuts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92a289c1ec18ea56909b6adf2fb826267b114300142d9286ab288ffabd180115
MD5 27c8601639dcacd5f132a952eb58e4b6
BLAKE2b-256 e46fbacbf25441b51486eeea4d72497328b03767547d6031744b97e33e49bf06

See more details on using hashes here.

File details

Details for the file pyaishortcuts-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyaishortcuts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7308b3f940c4ad64ab6537f199d2a5c5159b3028a29066960dd96075950b1d46
MD5 481a52daf8f47fd206e7c92d34406067
BLAKE2b-256 21e3910276c94a760f5b9ec9cebf8153aa08403e368292ba3337be02e392c803

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page