gpt-pynvim


Namegpt-pynvim JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/JFK/gpt-pynvim-plugin
SummaryA neovim plugin to generate code comments using OpenAI API.
upload_time2023-04-23 09:27:18
maintainer
docs_urlNone
authorYour Name
requires_python>=3.10
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GPT-PyNvim

[![lint](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/lint.yml/badge.svg)](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/lint.yml) [![test](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/test.yml/badge.svg)](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/test.yml) [![linkcheck](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/linkcheck.yml/badge.svg)](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/linkcheck.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40kiyotaman)](https://twitter.com/kiyotaman)


GPT-PyNvim is a Neovim plugin that uses OpenAI's GPT language model to generate code comments or documentation based on selected text within Neovim. This plugin requires Python 3.10 or higher.

## Directory Tree

```
gpt-pynvim/
├── autoload
│   └── gpt_pynvim.vim
└── python
    └── gpt_pynvim.py
```

## Installation

1. Clone the repository:

```
git clone https://github.com/JFK/gpt-pynvim-plugin ~/.config/nvim/plugin/gpt-pynvim
```

2. Install the required dependencies:

```
pip install -r requirements.txt
```

## Usage

1. Start Neovim.

2. Select the text you want to generate a comment or docstring for.

3. Press `,` to generate the output in a new window.

## Requirements

- Neovim
- Python 3.10 or higher

### requirements.txt

```
openai
pynvim
```

## Configuration

Ensure that your environment variable `OPENAI_API_KEY` is set to your OpenAI API key.

## Setting Up `OPENAI_API_KEY`

To set up the `OPENAI_API_KEY` environment variable, follow the instructions for your operating system:

### Linux and macOS

1. Open your terminal.

2. Open your shell profile file in a text editor. For example, if you are using the bash shell, open `~/.bashrc` or `~/.bash_profile`. If you are using the zsh shell, open `~/.zshrc`.

3. Add the following line to the file, replacing `your_api_key` with your actual OpenAI API key:

```bash
export OPENAI_API_KEY="your_api_key"
```

4. Save the file and close the text editor.

5. Restart your terminal or run `source ~/.bashrc`, `source ~/.bash_profile`, or `source ~/.zshrc` depending on the shell profile file you edited.

### Windows

1. Open the Start menu and search for "Environment Variables."

2. Click on "Edit the system environment variables."

3. In the "System Properties" window that opens, click on the "Environment Variables" button.

4. In the "Environment Variables" window, click on the "New" button under the "User variables" section.

5. Enter `OPENAI_API_KEY` as the variable name and `your_api_key` as the variable value, replacing `your_api_key` with your actual OpenAI API key.

6. Click "OK" to save the new environment variable.

7. Restart any open terminals or command prompts for the change to take effect.

Now, the `OPENAI_API_KEY` environment variable should be set and accessible to the GPT-PyNvim plugin.

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JFK/gpt-pynvim-plugin",
    "name": "gpt-pynvim",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "fumikazu.kiyota@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4f/c7/485364a41d553684c0a29cdc40856c2b7e15f95f02eb64d9192b84ab1d52/gpt-pynvim-0.1.1.tar.gz",
    "platform": null,
    "description": "# GPT-PyNvim\n\n[![lint](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/lint.yml/badge.svg)](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/lint.yml) [![test](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/test.yml/badge.svg)](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/test.yml) [![linkcheck](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/linkcheck.yml/badge.svg)](https://github.com/JFK/gpt-pynvim-plugin/actions/workflows/linkcheck.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40kiyotaman)](https://twitter.com/kiyotaman)\n\n\nGPT-PyNvim is a Neovim plugin that uses OpenAI's GPT language model to generate code comments or documentation based on selected text within Neovim. This plugin requires Python 3.10 or higher.\n\n## Directory Tree\n\n```\ngpt-pynvim/\n\u251c\u2500\u2500 autoload\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 gpt_pynvim.vim\n\u2514\u2500\u2500 python\n    \u2514\u2500\u2500 gpt_pynvim.py\n```\n\n## Installation\n\n1. Clone the repository:\n\n```\ngit clone https://github.com/JFK/gpt-pynvim-plugin ~/.config/nvim/plugin/gpt-pynvim\n```\n\n2. Install the required dependencies:\n\n```\npip install -r requirements.txt\n```\n\n## Usage\n\n1. Start Neovim.\n\n2. Select the text you want to generate a comment or docstring for.\n\n3. Press `,` to generate the output in a new window.\n\n## Requirements\n\n- Neovim\n- Python 3.10 or higher\n\n### requirements.txt\n\n```\nopenai\npynvim\n```\n\n## Configuration\n\nEnsure that your environment variable `OPENAI_API_KEY` is set to your OpenAI API key.\n\n## Setting Up `OPENAI_API_KEY`\n\nTo set up the `OPENAI_API_KEY` environment variable, follow the instructions for your operating system:\n\n### Linux and macOS\n\n1. Open your terminal.\n\n2. Open your shell profile file in a text editor. For example, if you are using the bash shell, open `~/.bashrc` or `~/.bash_profile`. If you are using the zsh shell, open `~/.zshrc`.\n\n3. Add the following line to the file, replacing `your_api_key` with your actual OpenAI API key:\n\n```bash\nexport OPENAI_API_KEY=\"your_api_key\"\n```\n\n4. Save the file and close the text editor.\n\n5. Restart your terminal or run `source ~/.bashrc`, `source ~/.bash_profile`, or `source ~/.zshrc` depending on the shell profile file you edited.\n\n### Windows\n\n1. Open the Start menu and search for \"Environment Variables.\"\n\n2. Click on \"Edit the system environment variables.\"\n\n3. In the \"System Properties\" window that opens, click on the \"Environment Variables\" button.\n\n4. In the \"Environment Variables\" window, click on the \"New\" button under the \"User variables\" section.\n\n5. Enter `OPENAI_API_KEY` as the variable name and `your_api_key` as the variable value, replacing `your_api_key` with your actual OpenAI API key.\n\n6. Click \"OK\" to save the new environment variable.\n\n7. Restart any open terminals or command prompts for the change to take effect.\n\nNow, the `OPENAI_API_KEY` environment variable should be set and accessible to the GPT-PyNvim plugin.\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A neovim plugin to generate code comments using OpenAI API.",
    "version": "0.1.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d49bf9731ea82c6d4c845fdfe7ffd70ab01d28c504f004b9cf052e2b131b30d6",
                "md5": "74664b754a5903f47c8a08b1516a1280",
                "sha256": "75c37ed2fc0e8799ee81536e05a323b164d8056def664a7e3d8fc4b2509cac54"
            },
            "downloads": -1,
            "filename": "gpt_pynvim-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "74664b754a5903f47c8a08b1516a1280",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 3249,
            "upload_time": "2023-04-23T09:27:16",
            "upload_time_iso_8601": "2023-04-23T09:27:16.300598Z",
            "url": "https://files.pythonhosted.org/packages/d4/9b/f9731ea82c6d4c845fdfe7ffd70ab01d28c504f004b9cf052e2b131b30d6/gpt_pynvim-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4fc7485364a41d553684c0a29cdc40856c2b7e15f95f02eb64d9192b84ab1d52",
                "md5": "86845e6bbbaf8c42e720277783274d04",
                "sha256": "9534481ae1fb7aa72785ff642c03fc2d54a488ca0f7a34931dc370fb5ebe76d3"
            },
            "downloads": -1,
            "filename": "gpt-pynvim-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "86845e6bbbaf8c42e720277783274d04",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 3343,
            "upload_time": "2023-04-23T09:27:18",
            "upload_time_iso_8601": "2023-04-23T09:27:18.912196Z",
            "url": "https://files.pythonhosted.org/packages/4f/c7/485364a41d553684c0a29cdc40856c2b7e15f95f02eb64d9192b84ab1d52/gpt-pynvim-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-23 09:27:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "JFK",
    "github_project": "gpt-pynvim-plugin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "gpt-pynvim"
}
        
Elapsed time: 0.06495s