Giter Club home page Giter Club logo

commit_crafter's Introduction

Commit Crafter

Installation

cargo install --locked commit_crafter

In the git project, install the prepare-commit-msg hook and set up the OpenAI API key to use it. If it is the first time installing and using it.

commit_crafter install

After executing the installation command, you must first set up a key in order to use it normally.

commit_crafter config set openai_api_key <your key>

Options

// openai api key
commit_crafter config set openai_api_key <your key>

// openai url
commit_crafter config set openai_url <your url>

// openai model
commit_crafter config set openai_model <your model>

// prompt language
commit_crafter config set user_language <your language>

// get config options
commit_crafter config get <option>

// get all config options
commit_crafter config list

Language List:

Language Code
English en
Japanese jp
简体中文 zh
繁体中文 zh_tw

The default file path is $HOME/.config/commit_crafter/config.toml

Usage

After correctly installing the hook, execute "git commit -a" in the git project. In the temporary Vim editor interface that opens, there will be generated commit information. The prerequisite is that all files have been staged for commit.

# prerequisites
git add . // or git add <file>

git commit -a

Configuration

To Do

  • Add more options to customize the commit message
  • Support more AI models
  • Support more languages
  • Add more tests
  • Improve README.md

commit_crafter's People

Contributors

yzzting avatar

Stargazers

 avatar  avatar saberuster avatar gezihuzi avatar Mike Tang avatar  avatar 邻二氮杂菲 avatar  avatar Tim Kersey avatar Yuexun avatar

Watchers

 avatar  avatar

commit_crafter's Issues

Counld not move prompt.toml

$ commit_crafter install                                                            ✔  10353  12:08:06
Warn: prompt.toml not found. Start generating default files.
thread 'main' panicked at /Users/sangshuduo/.cargo/registry/src/github.com-1ecc6299db9ec823/commit_crafter-0.1.2/src/config.rs:97:35:
Could not move prompt.toml: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Error: Request failed with status code: 400 Bad Request

Generating commit message from OpenAI...
Error: Request failed with status code: 400 Bad Request
Empty commit message generated. Commit aborted.

my config.toml is below:

openai_api_key = "<MY KEY>"
openai_url = "https://api.openai.com"
openai_model = "GPT-3.5 Turbo"
user_language = "en"

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.