Skip to content

Jawkx/cmtbot

Repository files navigation

cmtbot

A terminal apps that helps generate commit using AI

cmtbot demo

Installation

  1. Download the executable from Release page
  2. Make it executable
chmod +x <downloaded binary>
  1. (Optional but highly recommended) rename it to cmtbot
  2. Move it into place where you usually store your binary, EG: usr/local/bin, or anywhere directory that is in path, How to correctly add a path to PATH?

But I'm lazy, what now?

  1. Copy this and paste it in your terminal (remember to change the version in DOWNLOAD_URL eg: https://github.com/Jawkx/cmtbot/releases/download/v0.1.0/cmtbot-darwin-amd64)
# Macos
curl -L "https://github.com/Jawkx/cmtbot/releases/download/<VERSION>/cmtbot-darwin-amd64" -o cmtbot && chmod +x cmtbot && sudo mkdir -p /usr/local/bin 2>/dev/null && sudo mv cmtbot /usr/local/bin/cmtbot

# Linux
curl -L "https://github.com/Jawkx/cmtbot/releases/download/<VERSION>/cmtbot-linux-amd64" -o cmtbot && chmod +x cmtbot && sudo mkdir -p /usr/local/bin 2>/dev/null && sudo mv cmtbot /usr/local/bin/cmtbot

Setup

  1. To use this app, you first need to choose a LLM provider that have OpenAi compatible API (which is almost all of them). After getting a API key there, find a way to load it in your environment variable
  2. Create a directory ~/.config/cmtbot/
  3. In the directory create a file called prompt.md (or anything really), this will be your prompt used to generate the commit messages, you can check out a sample prompt file here
  4. After that create another file in the directory called config.toml
  5. In config.toml paste this and edit this base on your the environment variable key you setup in step 1 and also choose your model
api_base = "https://api.openai.com/v1/chat/completions" # OpenAi compatible Api root
api_key_env = "OPENAI_API_KEY" # Environment variable key
model_name = "gpt-4-turbo-preview" # Model
num_of_msg = 5 # number of mesage generated for selection
prompt_filename = "prompt.md" # File name you set in step 3`

Can reference this example config

About

Use llm to help you write commit messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages