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.0.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.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diff_agent-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 e81d30375372c9946c47836119382d2edc01a60c2739507f4c4dac4322827398
MD5 c25e6745f01ef6f6b41d0cb76c8bd5a7
BLAKE2b-256 8588bfa06d6e07a98e8b1a91cd6a74645c1e3b4c64758c6e4d57e2cc18442d63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: diff_agent-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0579c56dfece3236842d63d658beca054fb8ad48a07378a5d7f2e45de0a82f7
MD5 4e3e2e7e228bb6ff2e0622b789d32b42
BLAKE2b-256 bc1ff8ed3d00df2055c1858bcd5dd10bf9c6f5268eacc4d4f0a9ca6ec50afe6d

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