Skip to content

Automate your tasks with GPT Shortcuts, a powerful tool to interact with GPT directly from your clipboard!

License

Notifications You must be signed in to change notification settings

ghidav/gpt-clipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔮 GPT Clipboard

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

Setup

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.

⚠️You can freely customize the prompt to meet your personal needs!

Mac

To make GPT Clipboard to work on Mac you have to setup an action in Automator. Here's how to do it:

  1. When Automator opens, choose New Document.
  2. In the document type selection, choose Quick Action.
  3. 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.
gpt-clipboard
  1. Save quick action (it will be saved in /Users/name/Library/Services by deafult)
  2. Go to System Settings > Keyboard and click on Keyboard Shortcuts...
  3. Click on Services on the left panel and expand the Text section
  4. Here you can find the quick action and set a keyboard shortcut for it (e.g. ⌘⇧9)
Screenshot 2023-12-13 at 23 25 24

✅ 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! 🪄

About

Automate your tasks with GPT Shortcuts, a powerful tool to interact with GPT directly from your clipboard!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages