GithubHelp home page GithubHelp logo

gregorbiswanger / gitcommitwhisperer Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 1.0 111 KB

Git Commit Whisperer generate Git commit messages in Visual Studio Code using OpenAI technology.

License: MIT License

TypeScript 100.00%
chatgpt extension generator git gitmessage openai visual-studio-code vscode vscode-extension

gitcommitwhisperer's Introduction

Git Commit Whisperer

Git Commit Whisperer is a Visual Studio Code extension that helps you generate git commit messages using OpenAI's GPT-3 (ChatGPT).

WARNING This extension transmits your git diff to OpenAI-API. Using this extension on confidential repositories is not advised, as it could potentially breach your NDA.

Features

  • Automatically generate git commit messages based on the diff of your changes
  • Customize commit types using emojis
  • Configure custom prompts for OpenAI's GPT-3
  • Quick selection of commit types

Requirements

  • An OpenAI API key is required to use this extension

Installation

Install the extension from the Visual Studio Code Marketplace.

Usage

  1. Make sure you have a valid OpenAI API key, which can be obtained here.
  2. Configure the extension with your OpenAI API key:
    • Either enter it directly in the settings (generateCommitMessage.openaiApiKey)
    • Or, the extension will prompt you to enter your API key the first time you run the command
  3. Execute the Generate Commit Message command from the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
  4. If there are staged changes, select a commit type (or choose "Auto Detection") and let the extension generate a commit message for you.
  5. The generated commit message will be placed in the Source Control input box.

Configuration

You can customize the behavior of the Git Commit Whisperer by modifying the following settings:

{
  "generateCommitMessage.openaiApiKey": "your-openai-api-key",
  "generateCommitMessage.commitTypes": ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore", "revert"],
  "generateCommitMessage.useEmojiForCommitType": false,
  "generateCommitMessage.commitMessagePrompt": "your custom prompt"
}

Known Issues

  • The extension might not work properly if the Git diff is very large or if there are too many changes.
  • The commit message length might exceed the recommended 50 characters in some cases.

Contributing

If you have any suggestions or find any bugs, please open an issue on the GitHub repository.

License

This extension is licensed under the MIT License.

gitcommitwhisperer's People

Contributors

gregorbiswanger avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

schmaiki

gitcommitwhisperer's Issues

Promts

Prompt

I want you to act as a commit message generator. 
I will provide you with information about the git diff, 
and I would like you to generate an appropriate commit 
message using the conventional commit format and gitmoji. 
Do not write any explanations or other words, just reply 
with the commit message with maximal 50 character.

Test Git DIFF

diff --git a/src/extension.ts b/src/extension.ts
index cae3ad0..a3dc9ec 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -26,7 +26,7 @@ export function activate(context: vscode.ExtensionContext) {
                const openAIResponse = await openai.createCompletion({
                        model: "text-davinci-003",
                        prompt: prompt + ' ' + customPrompt + '\n\nTask information:' + diff,
-                       temperature: 0.7,
+                       temperature: 0.6,
                        max_tokens: 256,
                        top_p: 1,

Result:

๐ŸŽจ style(extension): adjust openai temperature #style #extension

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.