ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Open​AI completion

Sublime text OpenAI completion plugin.

Details

Installs

  • Total 407
  • Win 228
  • Mac 135
  • Linux 44
Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4
Windows 0 7 3 5 5 5 6 6 3 0 2 2 4 6 2 6 1 4 3 7 2 2 0 1 1 4 2 5 5 2 1 1 5 2 5 2 1 3 5 3 6 5 3 1 5 4
Mac 1 5 1 1 5 1 2 2 3 1 0 2 1 2 4 1 2 1 1 2 3 2 2 1 1 2 1 3 0 1 1 1 3 7 0 1 1 1 3 3 2 1 2 3 0 1
Linux 1 1 1 1 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 3 2 0 0 2 0 2 0 1 0 0 0 2 0 1 0 0 0 0 1 1 1 0 0

Readme

Source
raw.​githubusercontent.​com

OpenAI Sublime Text Plugin

Abstract

OpenAI Completion is a Sublime Text 4 plugin that uses the OpenAI natural language processing (NLP) model to provide suggestions for editing code within the Sublime Text editor.

Features

  • Append suggested text to selected code
  • Insert suggested text instead of placeholder in selected code
  • Edit selected code according to a given command

Demo

Click to see screens




Requirements

  • Sublime Text 4
  • OpenAI API key (paid service)
  • Internet connection

Usage

  1. Open the Sublime Text 4 editor and select some code.
  2. Open the command palette and run the OpenAI Append, OpenAI Insert, or OpenAI Edit command.
    • To use the OpenAI Insert command, the selected code should include a placeholder [insert]. This can be modified in the settings.
  3. The plugin will send the selected code to the OpenAI servers, using your API key, to generate a suggestion for editing the code.
  4. The suggestion will modify the selected code in the editor, according to the command you ran (append, insert, or edit).

Settings

The OpenAI Completion plugin has a settings file where you can set your OpenAI API key. This is required for the plugin to work. To set your API key, open the settings within Preferences -> Package Settings -> OpenAI -> Settings and paste your API key in the token property, as follows:

{
    "token": "sk-your-token",
}

Note

Please note that OpenAI is a paid service, and you will need to have an API key and sufficient credit to use the plugin.

Additionally, all selected code will be sent to the OpenAI servers for processing, so make sure you have the necessary permissions to do so.

Disclamer

This one was at 80% written by that thing itself including this readme. I was here mostly for debugging purposes, rather then designing and researching. This is pure magic, i swear.