Skip to main content

A CLI tool that generates semantic Japanese commit message prompts for LLMs from Git diff information.

Project description

komitto(コミット)

git diffの情報から、セマンティックなコミットメッセージプロンプトを生成するためのCLIツールです。生成されたプロンプトは自動的にクリップボードにコピーされ、LLMに貼り付けることで、コミットメッセージを作成できます。

主な機能

  • ステージングされた変更(git diff --staged)を解析
  • 変更内容をLLMが理解しやすいXML形式に変換
  • コミットメッセージ生成用のシステムプロンプトと結合
  • 生成された最終的なプロンプトをクリップボードにコピー
  • 変更に関する追加のコンテキスト(補足情報)をコマンドライン引数で付与する機能

インストール

pip install komitto

もし開発用にインストールする場合は、以下のコマンドを使用してください。

pip install -e .

使い方

  1. リポジトリで変更を行い、git addでファイルをステージングします。

    git add <変更したファイル>
    
  2. komittoコマンドを実行します。

    komitto
    
  3. ✅ プロンプトをクリップボードにコピーしました! と表示されたら、お使いのLLMのインターフェースにプロンプトを貼り付けてください。

追加コンテキストを渡す

変更の意図や特記事項など、プロンプトに含めたい補足情報がある場合は、引数として渡すことができます。

komitto "この変更は緊急のバグ修正です"

設定ファイルによるカスタマイズ

以下のコマンドを実行することで、カレントディレクトリに設定ファイルの雛形(komitto.toml)を生成できます。

komitto init

プロンプトの内容は、TOML形式の設定ファイルを作成することでカスタマイズ可能です。 以下の順序で設定ファイルを探索し、見つかった設定がデフォルト設定を上書きします(後勝ち)。

  1. OSごとのユーザー設定ディレクトリ(グローバル設定)
    • Windows: %APPDATA%\komitto\config.toml
      • 例: C:\Users\<User>\AppData\Roaming\komitto\config.toml
    • macOS: ~/Library/Application Support/komitto/config.toml
    • Linux: ~/.config/komitto/config.toml
  2. カレントディレクトリ(プロジェクト固有設定)
    • ./komitto.toml

設定ファイル (komitto.toml / config.toml) の記述例

[prompt]
# システムプロンプトの上書き
# """ で囲むことで改行を含めたテキストを記述できます
system = """
あなたは関西弁の陽気なエンジニアです。
コミットメッセージもノリよく生成してください。

形式:
<Type>: <Emoji> <Title>
...
"""

仕組み

  1. git diff --staged を実行し、ステージングされたファイルの差分を取得します。
  2. 差分情報を、ファイルパス、関数/クラス名、変更の種類(追加、修正、削除)などを含む構造化されたXML形式に変換します。
  3. あらかじめ定義されたシステムプロンプト、ユーザーが指定した追加コンテキスト、XML形式の差分情報を結合して、最終的なプロンプTプを生成します。
  4. 生成されたプロンプトをクリップボードにコピーします。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

komitto-0.1.2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

komitto-0.1.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file komitto-0.1.2.tar.gz.

File metadata

  • Download URL: komitto-0.1.2.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for komitto-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b2438b460255e01e6483d1b0a9bca99eb40e1f888b7f035ee32c823ac2da98a0
MD5 ec18efb7a094a2ae4ea0b07180066612
BLAKE2b-256 04451481618c3e59f4f615777111204f022efd424874b240074b69a8e2cdb12f

See more details on using hashes here.

Provenance

The following attestation bundles were made for komitto-0.1.2.tar.gz:

Publisher: publish.yaml on MXCAKE3893/komitto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file komitto-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: komitto-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for komitto-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6574efdde952edfe971219986638f807cb68df508a73af24e3551ecd01d996
MD5 012029caba617f6de214abdf27b2345d
BLAKE2b-256 3d346f6fedb9ec363e34d8dc37ab6166576856de4ebc0ba59772a0dce7ed016a

See more details on using hashes here.

Provenance

The following attestation bundles were made for komitto-0.1.2-py3-none-any.whl:

Publisher: publish.yaml on MXCAKE3893/komitto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page