1.0.5 โ€ข Published 8 months ago

@tusharkamra/commitly v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Commitly - Git Commit Message Generator ๐Ÿš€

Commitly is an npm package that uses AI to automatically generate clear and concise commit messages based on your staged changes. With just one click, it analyzes the differences in your code and creates an informative commit title and description, helping you save time and maintain consistent commit message standards. Perfect for developers who want to streamline their workflow and improve version control practices!

Features

  • Automatically generates Git commit messages based on staged changes.
  • Uses AI's model for generating natural language commit messages.
  • Commits the changes to the repository with the generated message.
  • Easily configurable using a .env file to store API keys and Git credentials.

Installation

Prerequisites

Make sure you have the following installed:

Install the npm package

npm install -g @tusharkamra/commitly

Set Up Environment Variables

To securely store your AI API key and other credentials, you'll need to create a .env file in your project. The package will load the environment variables from this file.

Edit the .env file with your credentials: Open .env in a text editor and set the following variables:

AI_MODEL_URI=your-ai-model-api-uri
AI_MODEL_NAME=ai-model-name
AI_MODEL_API_KEY=ai-model-api-key
AI_MODEL_MAX_TOKEN=ai-model-max-token

Make sure .env is not pushed to version control by adding it to .gitignore (if itโ€™s not already there)

Usage

Follow these steps to use the package effectively for creating and committing changes:

  1. Make Changes to Your Code:

    • Modify the files in your project as needed.
  2. Stage Your Changes:

    • Add the modified files to the staging area using the git add command:
      git add .
      This stages all your changes. You can also stage specific files by replacing . with the filename:
      git add filename
  3. Run the Command:

    • Use the package's command commitly to automatically generate a commit message and commit your changes:
      commitly
    • The tool will analyze your staged changes, generate a commit message using AI, and create the commit.
  4. Handle Errors (If Any):

    • If the tool encounters an issue (e.g., no internet connection, API failure, or empty staged changes), you will see an error message in the terminal.
    • You can manually create a commit by running:
      git commit -m 'Your commit message here'
  5. Verify the Commit:

    • To ensure your changes have been committed, you can check the latest commit using:
      git log
    • This will display the most recent commit details.

Contact

For any questions or feedback, feel free to reach out:

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago