@felipemantilla01/commit
v1.0.16
Published
A tool to generate commit messages using AI.
Downloads
1
Maintainers
Readme
@felipemantilla01/commit
Description
@felipemantilla01/commit
is a tool that facilitates the generation of commit messages using AI to analyze file changes and generate concise and well-structured commit messages. It is designed for developers who want to improve the quality of their commit messages and streamline the commit process.
Installation
To install the package globally, use the following command:
npm install -g @felipemantilla01/commit
Usage
Initial Setup
Before using the tool, you need to perform an initial setup to specify the AI provider and the API token:
commit --setup
This command will start an interactive prompt asking for the following information:
- AI Provider: Currently, only Anthropic is supported.
- API Token: Enter your API token for the selected AI provider.
- Commit Types: Select the commit types you want to use or add custom types.
The configuration will be saved in a file named commit-config.json
in the current directory.
Generate Commit Messages
To generate a commit message based on the staged files and the current diff, simply run:
commit
The command will perform the following actions:
- Read the staged files and get the diff.
- Read the content of the staged files.
- Generate a commit message using AI.
- Display the generated commit message and ask for confirmation before committing.
Sign Commits with GPG
If you want to sign your commits with GPG, you can use the -S
or --gpg-sign
option:
commit -S
Command Line Options
--setup
: Run the initial setup to specify the AI provider, API token, and commit types.-S
,--gpg-sign
: Sign commits with GPG.
Example
Run the initial setup:
commit --setup
Generate a commit message and commit:
commit
Generate a commit message and sign the commit with GPG:
commit -S
Contributing
Contributions are welcome. If you find an issue or have a suggestion, please open an issue in the GitHub repository.
License
This project is licensed under the MIT License.
Thank you for using @felipemantilla01/commit
!