Skip to main content

A tool for automatically committing and summarizing git changes

Project description

DiffAgent

A tool for automatically committing and summarizing git changes.

Installation

Install via pip:

pip install diff_agent

Usage

from diff_agent import DiffAgent

# Initialize the DiffAgent with desired model and prompt
agent = DiffAgent(
    model="ollama/llama3.1",  # Default model
    prompt="Summarize the code changes clearly and concisely",
    strong_model="openai/gpt-4o-mini",  # Strong model for larger diffs
    strong_model_threshold=10,  # Threshold to switch to strong model
    max_diff_len=5000,  # Max chars to send to the model
    log_file="whatIdid.txt"  # Optional log file to track changes
)

# Run the process and get the summary of changes
change_summary = agent.run()

# Print the result
print(change_summary)

Features

  • Automatically switch to a branch for commits and back to your original branch
  • Summarize code changes using LLMs
  • Ignore specified files from Git tracking
  • Log changes to a human-readable file
  • Switch to a more powerful model for complex changes

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

diff_agent-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

diff_agent-0.1.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diff_agent-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for diff_agent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 346425acb5d212dd6b76d356f3dbaf7fdb65f1206bf0482867f343d14f41a041
MD5 c165b80aada26a94b422f4baeba551cc
BLAKE2b-256 4b24a7698d1f5a81ae241f86b824bcf47d3feab21dea2597fadb4a96f5a538ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: diff_agent-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for diff_agent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 981b04d2f320bd7b7dd32d51c5c4a93fe882d693024760c6510c8bf10ec3204a
MD5 fc6a1f15e0a51774a2c5124833a00d3f
BLAKE2b-256 010e3e402fce7cfa9d6930b084d261782cf272006743994ed3893b0c154a4cd3

See more details on using hashes here.

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