Cloving Generate Commit Command Documentation

Learn how to use the cloving commit command to generate meaningful commit messages.

Usage

cloving generate commit [options]

There is also shortcut to save you a few chars

cloving commit [options]

And if you really hate typing

cloving c [options]

Options

This command uses the following options:

  • --silent or -s: Run the command in silent mode without interactive prompts.

Description

The cloving commit command generates a concise and meaningful commit message based on the current git diff. It uses the AI APIs configured with cloving config to analyze the diff and suggest a commit message, which can then be edited before finalizing the commit.

Interactive Prompts

The cloving commit command uses the following interactive prompts:

  • Git diff: The command automatically retrieves the git diff of the current changes.
  • Commit message generation: The command generates a prompt based on the diff and uses ClovingGPT to suggest a commit message.
  • Commit editing: The generated commit message is written to a temporary file, allowing the user to edit it before finalizing the commit.

Example Process

Example Commit Session

Here is an example of what a commit session might look like:

$ cloving commit
Add "Copied" notification and update sidebar

- Implement "Copied" notification for code copy functionality
- Add new CSS file for copied notification styles
- Update sidebar with documentation structure and links
- Create new partial views for documentation pages

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch adding-documentation
# Changes to be committed:
#       modified:   app/assets/stylesheets/application.tailwind.css
#       new file:   app/assets/stylesheets/copied_notification.css
#       modified:   app/javascript/controllers/homepage_controller.js
#       modified:   app/views/application/_sidebar.html.erb
#       new file:   app/views/docs/_commit.html.erb
#       new file:   app/views/docs/_config.html.erb
#       new file:   app/views/docs/_generate-code.html.erb
#       new file:   app/views/docs/_generate-context.html.erb
#       new file:   app/views/docs/_generate-review.html.erb
#       new file:   app/views/docs/_generate-shell.html.erb
#       new file:   app/views/docs/_generate-unit-tests.html.erb
#       new file:   app/views/docs/_init.html.erb
#       new file:   app/views/docs/_models.html.erb
#       modified:   app/views/docs/show.html.erb

The generated commit message is opened in the default editor for final review and editing before the commit is finalized.