{"id":28547066,"url":"https://github.com/skywind3000/vim-gpt-commit","last_synced_at":"2025-06-28T17:34:03.113Z","repository":{"id":222427614,"uuid":"755901161","full_name":"skywind3000/vim-gpt-commit","owner":"skywind3000","description":":rocket: Generate git commit message using ChatGPT and Ollama !!","archived":false,"fork":false,"pushed_at":"2025-02-07T16:25:21.000Z","size":51,"stargazers_count":48,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T00:09:05.906Z","etag":null,"topics":["chatgpt","chatgpt-app","neovim","neovim-plugin","neovim-plugins","vim","vim-plugin","vim-plugins"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skywind3000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-11T12:34:32.000Z","updated_at":"2025-02-09T10:51:50.000Z","dependencies_parsed_at":"2024-03-21T04:25:48.875Z","dependency_job_id":"e54aebcc-50f7-429f-827a-470ce7422840","html_url":"https://github.com/skywind3000/vim-gpt-commit","commit_stats":null,"previous_names":["skywind3000/vim-gpt-commit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/skywind3000/vim-gpt-commit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fvim-gpt-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fvim-gpt-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fvim-gpt-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fvim-gpt-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skywind3000","download_url":"https://codeload.github.com/skywind3000/vim-gpt-commit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fvim-gpt-commit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262469392,"owners_count":23316314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chatgpt-app","neovim","neovim-plugin","neovim-plugins","vim","vim-plugin","vim-plugins"],"created_at":"2025-06-10T00:09:10.953Z","updated_at":"2025-06-28T17:34:03.108Z","avatar_url":"https://github.com/skywind3000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Preface\n\nGenerate proper git commit message using ChatGPT (or [Ollama](https://github.com/ollama/ollama)) in Vim:\n\n![](https://skywind3000.github.io/images/p/misc/2024/gptcommit1.gif)\n\nThis plugin provides a `:GptCommit` command to generate commit message and append in the current buffer.\n\nUsually, it can be used when editing the `COMMIT_EDITMSG` file, or in a fugitive commit window.\n\n## Quick start\n\nFor vim-plug:\n\n```vimL\nPlug 'skywind3000/vim-gpt-commit'\n\nlet g:gpt_commit_key = 'Your openai apikey'\n\" uncomment this line below to enable proxy\n\" let g:gpt_commit_proxy = 'socks5://127.0.0.1:1080'\n\n\" uncomment the following lines if you want to use Ollama:\n\" let g:gpt_commit_engine = 'ollama'\n\" let g:gpt_commit_ollama_url = 'http://127.0.0.1:11434/api/chat'\n\" let g:gpt_commit_ollama_model = 'llama2'\n```\n\nFor lazy:\n\n```lua\n{\n    'skywind3000/vim-gpt-commit',\n    config = function ()\n        -- if you don't want to set your api key directly, add to your .zshrc:\n        -- export OPENAI_API_KEY='sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\n        vim.g.gpt_commit_key = os.getenv(\"OPENAI_API_KEY\")\n        -- uncomment this line below to enable proxy\n        -- vim.g.gpt_commit_proxy = 'socks5://127.0.0.1:1080'\n\n        -- uncomment the following lines if you want to use Ollama:\n        -- vim.g.gpt_commit_engine = 'ollama'\n        -- vim.g.gpt_commit_ollama_url = 'http://127.0.0.1:11434/api/chat'\n        -- vim.g.gpt_commit_ollama_model = 'llama2'\n    end,\n},\n```\n\nRequirements:\n\n- Python: A Python 3 executable binary needs to be located in your `$PATH`, but vim's `+python3` feature is not required.\n\n## Command\n\nThis plugin provides only one command:\n\n```VimL\n:GptCommit[!] [repo_path]\n```\n\nIt will generate git commit message and append to the current cursor position. If the `repo_path` is omitted, the directory name of the current buffer will be used.\n\nIf the bang (`!`) is included, `:GptCommit` will not append any text to the current buffer, instead, it will only store the messages in the unnamed register (`*`). You can use them any time manually by `\"*p` or display the content by:\n\n```VimL\n:echo @*\n```\n\nYou will see the result in the command line.\n\n## Options\n\n| Name | Required | Default | Description |\n|-|-|-|-|\n| g:gpt_commit_key | Yes | `''` | Your openai apikey |\n| g:gpt_commit_proxy | - | `''` | proxy |\n| g:gpt_commit_concise | - | `0` | set to 1 to generate less verbose message |\n| g:gpt_commit_lang | - | `''` | output language |\n| g:gpt_commit_model | - | `'gpt-3.5-turbo'` | ChatGPT model |\n| g:gpt_commit_staged | - | `1` | set to 1 to use staged diff |\n| g:gpt_commit_max_line | - | `160` | max diff lines to reference |\n| g:gpt_gpt_commit_max_logs | - | `0` | max log history (git log) use as context |\n| g:gpt_commit_url | - | `''` | alternative request URL, see #1 |\n| g:gpt_commit_python | - | `''` | specify the Python executable file explicitly |\n| g:gpt_commit_engine | - | `'chatgpt'` | change to 'ollama' to use Ollama |\n| g:gpt_commit_ollama_model | Yes | `''` | ollama model |\n| g:gpt_commit_ollama_url | - | `''` | explicitly setting ollama URL|\n\nNote #1: the default URL is \"https://api.openai.com\", can be changed by setting `g:gpt_commit_url`.\n\n## Script\n\nFor command line usage, you can execute `gptcommit.py` in the `bin` directory:\n\n```\nusage: python3 gptcommit.py \u003coptions\u003e repo_path\navailable options:\n  --key=xxx       required, your openai apikey\n  --staged        optional, use staged diff if present\n  --proxy=xxx     optional, proxy support\n  --maxline=num   optional, max diff lines to feed ChatGPT, default ot 160\n  --model=xxx     optional, can be gpt-3.5-turbo (default) or something\n  --lang=xxx      optional, output language\n  --concise       optional, generate concise message if present\n  --utf8          optional, output utf-8 encoded text if present\n  --url=xxx       optional, alternative openai request url\n  --maxlogs=num   optional, use git \u003cnum\u003e log entries to enrich the context\n```\n\nIt can be integrated into other editors. \n\n## Credit\n\nIf you find this plugin amusing, you might also be interested in my other vim plugins, such as:\n\n- [vim-auto-popmenu](https://github.com/skywind3000/vim-auto-popmenu): Display the completion menu automantically.\n- [vim-color-export](https://github.com/skywind3000/vim-color-export): A tool to backport NeoVim colorschemes to Vim. \n- [vim-navigator](https://github.com/skywind3000/vim-navigator): Navigate your commands easily.\n- [vim-rt-format](https://github.com/skywind3000/vim-rt-format): Prettify current line when you press Enter.\n- [vim-quickui](https://github.com/skywind3000/vim-quickui): The missing UI extensions for Vim 8.2 (and NeoVim 0.4).\n- [asynctasks.vim](https://github.com/skywind3000/asynctasks.vim): Modern task system for project building/testing/deploying.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywind3000%2Fvim-gpt-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskywind3000%2Fvim-gpt-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywind3000%2Fvim-gpt-commit/lists"}