Show HN:使用 gitz (Rust 與 AI) 自動化 Git 提交訊息

Show HN:使用 gitz (Rust 與 AI) 自動化 Git 提交訊息

Hacker News·

一款名為 gitz 的新開源工具,結合了 Rust 和 AI 技術,旨在自動生成一致的 Git 提交訊息和 README 文件,以提升開發者效率。

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

To see all available qualifiers, see our documentation.

A modern git commit and readme generator to help every dev to wwrite consistant messages.

License

Uh oh!

There was an error while loading. Please reload this page.

Tenuka22/gitz

Folders and files

Latest commit

History

Repository files navigation

🚀 gitz-cli

Craft intelligent Git commit messages with AI, enhancing your development workflow.

Image

Image

Image

Image

🌟 Table of Contents

✨ Features

gitz-cli is an AI-powered command-line tool designed to streamline your Git workflow by automatically generating conventional commit messages. It acts as an AI assistant, running manually from the command line as needed before committing to replace manual code review processes with AI suggestions.

🚀 Quick Start

Get gitz-cli up and running in under 30 seconds!

Install Rust: If you don't have Rust installed, follow the instructions on rustup.rs.

Get your Gemini API Key: Obtain a GEMINI_API_KEY from Google AI Studio.

Install gitz-cli:

Set Environment Variable:

Generate a commit message:

📦 Installation

gitz-cli is a Rust-based command-line tool. You'll need the Rust toolchain installed to compile and install it.

Prerequisites

Install with Cargo

The easiest way to install gitz-cli is through cargo from crates.io:

Install from Source

You can also build and install gitz-cli directly from its source code from the repository maintained by Tenuka22:

💻 Usage

gitz-cli is designed to be run manually from the command line before you commit your changes. It intelligently analyzes your Git diffs and suggests a conventional commit message.

Core Command: gitz-cli commit

This command is the primary entry point for generating commit messages.

⚠️ Important: You must provide either stage or any. If neither is specified, gitz-cli will prompt you or show an error.

Examples

Generate a commit message for staged changes:

Expected output:

Generate a commit message for all local changes:

Expected output:

⚙️ Configuration

gitz-cli relies on the GEMINI_API_KEY for interaction with the Google Gemini AI.

Environment Variables

💡 Tip: To influence the AI's understanding of your changes, gitz-cli filters and truncates diffs. You can customize the file filtering logic by adding a .gitzignore file in your repository's root, similar to .gitignore. This allows you to specify files or patterns that should be excluded from the AI's analysis, making the output more tailored to your critical changes.

📖 Examples

Let's walk through a common scenario to see gitz-cli in action.

Scenario: Adding a New Feature and Generating a Commit Message

Imagine Tenuka22 is working on a new feature that involves adding a function to src/main.rs and updating Cargo.toml with a new dependency.

Initial Status:

Make Changes:

Check Diff:

Stage Changes:

Generate Commit Message with gitz-cli:

Review and Commit:
The generated message can then be copied and used directly in your git commit -m command, or you can use gitz-cli commit -e (if available, this feature is not explicitly listed, so I'll keep it simple by just showing message generation).

Or, if gitz-cli just prints to stdout, you'd manually paste it.

🤝 Contributing

We welcome contributions to gitz-cli! Whether it's reporting bugs, suggesting features, or submitting code, your help is appreciated.

Development Setup

To get started with development on gitz-cli, follow these steps:

📝 License

This project is licensed under the MIT License.

Copyright (c) 2023 Tenuka22.

See the LICENSE file for more details.

About

A modern git commit and readme generator to help every dev to wwrite consistant messages.

Resources

License

Uh oh!

There was an error while loading. Please reload this page.

Stars

Watchers

Forks

Releases

  3

Languages

Footer

Footer navigation

Hacker News

相關文章

  1. Smart Commit:一個保留在 CLI 中的 AI 輔助 Git Commit 工作流程

    4 個月前

  2. Sage:AI驅動的Git提交訊息和分支名稱生成器

    3 個月前

  3. Show HN:Cmt 是一款 AI 驅動的 Git Commit 訊息生成器

    4 個月前

  4. Show HN:用於追蹤 AI 程式碼與提示的 Git 擴充功能

    3 個月前

  5. Show HN:Gen Commit – AI 為您的 Git Commit 訊息生成內容

    8 個月前