Skip to content

The smart way to write your commit messages using Conventional Commits.

License

Notifications You must be signed in to change notification settings

ragnarok22/gsmart

GSmart

The smart way to write your commit messages using Conventional Commits.

NPM Downloads NPM Version NPM License npm bundle size NPM Unpacked Size NPM Type Definitions

GSmart image

Installation

npm install -g gsmart

Usage

After installing the package, you can use the gsmart command to write your commit messages. First you need to provide your API key for any of the supported AI services. You can use the gsmart login command to do this.

gsmart login
? Select a provider > suse arrow keys to navigate
❯ OpenAI
  Anthropic

After selecting a provider, you will be prompted to enter your API key.

? Enter your API key:

To generate a commit message, you need to be in a git repository and have some changes to commit. Add the changes to the staging area using the git add command. Then you can use the gsmart command to write your commit message.

gsmart

Generate options

If can add different providers. If you want to use a specific provider, you can use the --provider option.

gsmart --provider anthropic

You can also specify the prompt to use for the AI model, using the --prompt option.

gsmart --prompt "Explaining the changes in the staging area"
Usage: gsmart [options] [command]

CLI to generate smart commit messages using AI. generate command is the default command.

Options:
-V, --version   output the version number
-h, --help      display help for command

Commands:
generate        Generate a commit message based on the changes in the staging area
login           Login to a provider to use their AI service
reset           Reset the API key for all providers and remove the configuration file
help [command]  Display help for command

Providers

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.