ChatGPT Plugin for retrieving external API documentation and reading and writing to local files.
As an avid coder, I embarked on a personal experiment to enhance my coding experience and boost my productivity. I found ChatGPT to be a valuable tool, but copying and pasting generated code into my editor often proved inconvenient and disrupted my creative flow.
I also faced challenges due to ChatGPT's inability to access my local file system and external documentation, as it couldn't utilize my current project's code as context. This meant I had to manually copy my code to the website for further generation.
To overcome these limitations, I decided to create the ChatGPT Code Assistant Plugin. By granting ChatGPT access to both my local file system and the internet, it can now effortlessly:
Through this personal experiment, I have experienced the enhanced capabilities of the ChatGPT Code Assistant Plugin and revolutionized the way I code. I hope others can also benefit from this solution and transform their coding journeys.
pip install -r requirements.txt
Run the following command to start the server:
uvicorn main:app --reload
Now, use ngrok to expose the server to the internet. Ngrok is needed because the chatgpt plugins requires an https url to work.
ngrok http 8000
Use the ngrok url to set the server url in the plugin settings.
Here is a demo of the plugin in action:
This section provides instructions for setting up your text editor to automatically refresh when a file is updated by the Plugin. You can either use the provided scripts, or follow the manual configuration steps for your platform and editor.
Run the appropriate script for your platform and editor:
./scripts/setup_auto_refresh/unix/setup_nvim_vim.sh
./scripts/windows/setup_auto_refresh/setup_nvim_vim.bat
./scripts/setup_auto_refresh/unix/setup_emacs.sh
./scripts/setup_auto_refresh/windows/setup_emacs.bat
./scripts/setup_auto_refresh/setup_vscode.sh
./scripts/setup_auto_refresh/setup_vscode.bat
These scripts will automatically configure your text editor for auto-refresh functionality when the ChatGPT Plugin "Code Assistant" updates a file.
Install the vim-plug plugin manager if you haven't already by following the instructions here.
Add the following lines to your init.vim
configuration file (usually located in ~/.config/nvim/init.vim
):
call plug#begin()
Plug 'djoshea/vim-autoread'
call plug#end()
let g:auto_read = 1
Save the file and run :PlugInstall
in Neovim.
Install the vim-plug plugin manager if you haven't already by following the instructions here.
Add the following lines to your vimrc
configuration file (usually located in ~/.vimrc
):
call plug#begin()
Plug 'djoshea/vim-autoread'
call plug#end()
let g:auto_read = 1
Save the file and run :PlugInstall
in Vim.
Install the auto-revert-mode
package by running M-x package-install RET auto-revert-mode RET
.
Add the following line to your Emacs configuration file (usually located in ~/.emacs.d/init.el
or ~/.emacs
):
(global-auto-revert-mode 1)
Save the file and restart Emacs.
Ctrl+Shift+X
.With these configurations, your editor should automatically refresh when a file is updated by the Plugin.