Automate your tasks with GPT Shortcuts, a powerful tool to interact with GPT directly from your clipboard!
Requirements
- Python installed on your pc
- An OpenAI API key
Clone the repository and install the python requirements.
git clone https://github.com/ghidav/gpt-clipboard.git
cd gpt-clipboard
pip install -r requirements.txt
You also need to know the path to your pyhton compiler, to find it you can use which python
or which python3
.
Open the python script (coding.py
) and paste your OpenAI API key in os.environ["OPENAI_API_KEY"] = "..."
. The example contains the prompt for code completion, here's the prompt passed to the model before the selected text:
You are a coding assistant.
You read code and a comment; you take the comment as an instruction to complete the code.\nYou write only the code completion.
To make GPT Clipboard to work on Mac you have to setup an action in Automator. Here's how to do it:
- When Automator opens, choose New Document.
- In the document type selection, choose Quick Action.
- Configure the Quick Action:
- In the left panel, search for Run Bash Script and double click it.
- In the right panel, set everything as shown in the following image.

- Save quick action (it will be saved in /Users/name/Library/Services by deafult)
- Go to System Settings > Keyboard and click on Keyboard Shortcuts...
- Click on Services on the left panel and expand the Text section
- Here you can find the quick action and set a keyboard shortcut for it (e.g. ⌘⇧9)

✅ You're all set! Now, select a text and type the shortcut you chose to see the output of GPT magically appear in your clipboard! 🪄