Ubuntu 試用 gptcommit 懶人工具

請先申請 openAI key, 透過 chatgpt 網站申請

Reference and Source site

Startup

Install curl and cargo

sudo apt update
sudo apt install curl -y
sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source '$HOME/.cargo/env'
rustc --version

Install gptcommit tool

cargo install --locked gptcommit

Set gptcommit with your openAI key

gptcommit config set openai.api_key sk-XXXXXXXXXXOOOOOOOO....

Install gptcommit act on your Repositories

cd [your_reoisutry_path]
gptcommit install

Installing gptcommit hook...
Installing git hook to [your_reoisutry_path]
gptcommit hook successfully installed!

Try and enjoy it

vim anything
git commit -a

Troubleshooting

rustc version too old, require XXXXX or later

sudo apt remove cargo
sudo apt autoremove

gptcommit commad not found

source '$HOME/.cargo/env'

  目錄