Skip to main content

A semi-autonomous framework for easily developing repo-wide changes

Project description

diffdev

diffdev is a command-line tool that helps you make repo-wide code changes using an AI assistant. It allows you to interactively select files, provide a prompt describing the desired changes, and apply the AI-generated modifications as a git patch.

Key Features

  • File Selection: Use a TUI to select files to include in the context
  • Context-Aware Changes: The AI assistant analyzes the selected files and your prompt to generate contextual changes
  • Structured Patch Generation: Changes are returned as a git-style patch for easy application and review
  • Revision Control Integration: Apply patches using git apply and rollback changes when needed
  • Claude AI Assistant: Leverages the powerful Claude language model from Anthropic

Requirements

  • Python 3.11 or higher
  • Git installed and available in PATH
  • Anthropic API key

Installation

# Install from PyPI
pip install diffdev

# Set your Anthropic API key
export ANTHROPIC_API_KEY="your-api-key-here"

Usage

  1. Navigate to your git repository
  2. Run diffdev
  3. Use the TUI to select files for context:
    • Space: Toggle file/directory selection
    • Tab: Expand/collapse directories
    • Enter: Confirm selection
    • q: Quit selection
  4. Enter your prompt describing the desired changes
  5. Review and confirm the generated patch

Commands

  • select: Open file selector to update context
  • undo: Rollback last applied changes
  • redo: Reapply last rolled back changes
  • exit: Exit diffdev

Example

$ cd my-project
$ diffdev

Starting diffdev...
Select files to include in the context:
[ ] + src/
[ ] + tests/
[ ] README.md

# After selecting files and confirming...

Enter command or prompt: Add type hints to the User class methods

# AI will analyze files and generate changes
# Changes are applied as a git patch that can be rolled back if needed

Development

Contributions are welcome! Please feel free to submit a Pull Request.

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

diffdev-0.1.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

diffdev-0.1.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diffdev-0.1.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for diffdev-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1c60408ac5c5e672b08bc20e038b0b2b85356b08f2feab6456020520622f9d5f
MD5 4e1ccf88403f7f8e66f81758776e9154
BLAKE2b-256 d9d5c3ecb41f3f56f1382789f22a856236acc203ca6134b44d7550730316d0bc

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Mockapapella/diffdev

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

File details

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

File metadata

  • Download URL: diffdev-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for diffdev-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63ee38066d8a25dcbe55ef8d7250119db2582061501f52d676ad93beecf68fc9
MD5 f5c97b926b19dbd6a76bc11855ae3af1
BLAKE2b-256 b54e79283719c99bf88be75555889f1e83fcd0e487552a899094e9c03a9b31ac

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Mockapapella/diffdev

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