0.5.0 • Published 4 months ago

git-meld v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

šŸ”„ git-meld

Enhance your git commits with AI-powered commit messages!

git-meld is a CLI tool that uses AI to analyze your changes and generate meaningful, detailed commit messages. It's like having a helpful co-pilot for your git commits! šŸš€

✨ Features

  • šŸ¤– Uses AI to analyze your git diff and generate detailed commit messages
  • šŸ”„ Powered by OpenRouter - access to multiple AI models
  • šŸŽÆ Considers both staged changes and git status
  • 😊 Adds relevant emojis to make your commits more expressive
  • šŸ”’ Securely stores your API key in your system's keychain
  • šŸš€ Simple to use - just replace git commit with meld
  • šŸ“ Support for custom commit guidelines via .meld file

šŸ“¦ Installation

npm install -g git-meld

šŸ› ļø First Time Setup

On first run, git-meld will ask for your OpenRouter API key:

meld
# Follow the prompt to enter your OpenRouter API key

Get your API key from OpenRouter. Your API key will be stored securely in your system's keychain.

By default, git-meld uses the openai/o1-mini-2024-09-12 model, but you can easily switch to any other model available on OpenRouter.

šŸ’” Usage

  1. Stage your changes as usual:
git add .  # or git add <specific-files>
  1. Instead of git commit, use:
meld "brief description"

The tool will analyze your changes and generate a detailed, meaningful commit message!

Commands

  • meld "your message" - Create an enhanced commit message
  • meld --dry "message" - Preview the commit message without committing
  • meld --choose-model - Select an AI model from available models
  • meld --set-model "model-id" - Set model ID directly (e.g., "anthropic/claude-2")
  • meld --reset-key - Reset the stored API key and model choice
  • meld --help - Show help information

Choosing a Model

You can choose from any model available on OpenRouter:

# Interactive model selection
meld --choose-model

# Direct model setting
meld --set-model "anthropic/claude-2"

Custom Commit Guidelines

You can create a .meld file in your repository root to provide additional instructions for commit message generation. These instructions will be included every time a commit message is generated.

Example .meld file:

Follow conventional commits format (feat, fix, docs, etc)
Include ticket number from Jira (e.g., PROJ-123)
Keep subject line under 72 characters

The contents of this file will be added to the AI prompt, helping to maintain consistent commit message style across your project.

šŸ“ Example

$ git add feature.ts
$ meld "add user auth"

# Generated commit message might look like:
✨ feat(auth): Implement user authentication system

- Add JWT token validation middleware
- Create secure password hashing functionality
- Implement session management

šŸ¤” Why git-meld?

"Meld" is a Dutch word meaning "report" or "announce". This tool helps you announce your changes in a more meaningful way, ensuring your git history is clear and informative.

šŸ”‘ Security

Your API key is stored securely in your system's keychain, not in plain text files.

šŸ“„ License

MIT Ā© 2024

šŸ› Issues

Found a bug? Please open an issue!

0.5.0

4 months ago

0.4.0

5 months ago

0.3.0

5 months ago

0.2.0

5 months ago

0.1.0

5 months ago