Wox/docs/usecase_auto_write_git_comm...

1.4 KiB

Auto Git Commit Message

This feature allows you to automatically generate a commit message using Wox AI Command from terminal.

Setup

  1. Add AI command
  • Query aicommand in Wox and select Open AI Commands settings
  • In the Settings tab, click on the Add button
  • Add the following information:
    • Name: git commit msg
    • Query: commit
    • Model:
    • Prompt:

    Below I will give you a git diff output, please help me write a commit msg targeting these changes. Requirements are as follows:

    • The first line should be a description no more than 50 words, followed by a blank line, and then 2-3 detailed descriptions.
    • Do not respond with anything except the commit msg.

    Here is my input: %s

    • Vision: No

AI git msg setting

  1. Config bash scripts To use this feature, you can add the following script to your .bashrc or .zshrc file:
commit() {
    open "wox://query?q=ai commit $(cat)"
}

Usage

After setting up, you can use this feature in your git project by executing the following command:

git diff | commit

This command will automatically call Wox and generate a commit message for you.

AI git msg