PitchHut logo
difit
View Git diffs in a GitHub-like interface with ease.
Pitch

difit is a lightweight command-line tool designed for reviewing Git commit diffs in a user-friendly web interface similar to GitHub’s Files changed view. With clean visuals and support for AI-generated comments, it simplifies the code review process for developers looking to enhance their workflow.

Description

difit provides a lightweight command-line interface (CLI) tool that simplifies viewing and reviewing Git commit diffs with a GitHub-like interface. Aimed at enhancing the code review process, difit allows users to effortlessly navigate local diffs while offering clean visuals and the ability to generate AI prompts from comments. This tool is designed for developers looking to streamline their code review workflow in the era of AI.

Key Features

  • Modern Git Diff Viewer: Experience a visually appealing and user-friendly interface for Git commit differences.
  • AI Integration: Easily copy comments as prompts for AI coding agents, facilitating better communication and code reviews.
  • Versatile Usage:
    • View Single Commits: Review the latest or specific commits seamlessly with commands like npx difit <commit>.
    • Compare Branches and Commits: Use npx difit <branch1> <branch2> to compare branches or commits directly.
    • Support for GitHub Pull Requests: Review PRs by directly passing the GitHub URL using npx difit --pr <github-pr-url>.
  • Special Arguments: The tool recognizes special keywords to view different diff scenarios, such as all uncommitted changes or staged changes.

Examples of Usage

To view the latest commit diff in a browser:

npx difit

To compare your current working directory with the main branch:

npx difit . origin/main

For viewing diffs from other tools:

diff -u file1.txt file2.txt | npx difit

Comment System

The integrated comment system allows users to provide structured feedback:

  • Click to add comments on specific lines or to select ranges.
  • Comments can be edited or collectively copied in a format suitable for AI prompts.
  • Comments are saved in the local storage of the browser after each commit review.

Architecture and Development

The application's architecture includes:

  • A CLI built on Commander.js for robust argument validation.
  • A backend utilizing Express and simple-git for diff processing.
  • Integration with GitHub through Octokit for streamlined authentication and API usage.
  • A frontend developed in React with TypeScript, styled using Tailwind CSS.

Requirements

  • Node.js version 21.0.0 or later.
  • A Git repository containing commits for review.

difit is a powerful solution for developers looking to enhance their code review processes through an intuitive and modern interface, making it easier to manage and review code changes effectively.

0 comments

No comments yet.

Sign in to be the first to comment.