A terminal apps that helps generate commit using AI
- Download the executable from Release page
- Make it executable
chmod +x <downloaded binary>
- (Optional but highly recommended) rename it to
cmtbot
- 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?
- 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
- 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
- Create a directory
~/.config/cmtbot/
- 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 - After that create another file in the directory called
config.toml
- 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