diffbro


Namediffbro JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/disler/diffbro.git
SummaryYour personal AI assistant bro for better code reviews.
upload_time2023-09-04 17:29:04
maintainer
docs_urlNone
authorIndyDevDan
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # diffbro - AI Powered Peer Reviews

*Your AI Peer Review Bro*

Diffbro is a command line tool that gives you AI powered peer reviews on your codebase. Under the hood diffbro utilizes `git diff` and OpenAI's *GPT-3.5-turbo* and *GPT-4* to review your code and provide feedback on your changes. 

Diffbro is best used before you stage and commit your code to your codebase. Diffbro also supports full branch diff PR feedback as if it were an engineer reviewing your merge request (see `--peer-review` flag). Diffbro is designed to help you catch bugs, improve your code quality, and help you ship with confidence.

![Diffbro Header](https://firebasestorage.googleapis.com/v0/b/solopreneur-d8361.appspot.com/o/Diffbro%2Fdiffbro.jpg?alt=media&token=fefc8d90-10e2-4091-9b03-957af25aee3b)

## Features

- View all commands, options and examples
  - `diffbro --help`

- Run against local changes
  - `diffbro`

- Run diffbro against a branch and create a PR review
  - `diffbro --peer-review main`

- Different bro modes for chill, to chad engineer level peer reviews
  - chill: will review your code like a chill bro (default)
    - `diffbro --chill`
  - mid: will review your code like a mid level engineer bro
    - `diffbro --mid`
  - chad: will review your code like a chad, staff engineer bro
    - `diffbro --chad`

- Choose which files to review
  - Only .py and .js files
    - `diffbro --only .py .js`
  - Everything except .py and .js files
    - `diffbro --ignore .py .js`
  - *Defaults to [".py", ".c", ".cpp", ".java", ".cs", ".php", ".vb", ".html", ".css", ".js", ".ts", ".asp", ".aspx", ".cfm", ".cgi", ".pl", ".cer", ".htm", ".xhtml", ".shtml", ".jsp", ".jsx", ".tsx", ".vue", ".solid", ".toml", ".md", ".go", ".rs", ".swift"]*

- Choose your gpt model
  - `diffbro --model gpt-3.5-turbo`
  - `diffbro --model gpt-4` (default) (recommended for production code)

- Summarize the git diff for a commit message or PR description
  - `diffbro --summarize`

- Override the default prompts with your own custom prompt
  - `diffbro --prompt "Below is a git diff of code. Please review and notify only of critical issues. If there are no critical issues, respond with tons of checkbox emojis"`

- Example command combos
  - '*I want a chill review on my .py and .js files*'
    - `diffbro --chill --only .py .js`
  - '*I'm about to ship production, mission critical UI code, I need a hardcore review on my FE code*'
    - `diffbro --chad --model gpt-4 --only .js .jsx .tsx .vue`
  - '*I'm about to a fullstack app and need a comprehensive mid level review on all my code excluding .tsx files*'
    - `diffbro --mid --model gpt-4 --ignore .tsx`
  - '*I want to run my own prompt against my git diff with a summary for the commit massage*'
    - `diffbro --prompt "Below is a git diff of code. Please review and notify only of critical issues." --summarize`
  - '*I want a quick comparison of my changes against the staging branch with a summary*'
    - `diffbro --peer-review staging --model gpt-3.5-turbo --summarize`
  - '*I want a mid level code review of all of my .ts files*'
    - `diffbro --mid --only .ts`
  - '*I want top tier code reviews all the time*'
    - Throw this line into your `.bashrc` or `.bash_profile`
      - `alias dbro="diffbro --chad --model gpt-4 --summarize"`
    - Then, whenever you want a review, just run
      - `dbro`

## Install & Use

- Install or switch to [Python 3.11 or 3.10 or 3.9 or 3.8](https://www.python.org/downloads/)
  - Check your python version
    - `python --version`

- Install '*stable*' version from [PyPI](https://pypi.org/)
  - `pip install --upgrade diffbro`

- Export your openai api key
  - `export OPENAI_API_KEY=<your-openai-api-key>`

- Make changes to your codebase

- Run diffbro
  - `diffbro`

### Compare local changes

- Before you stage and commit, run diffbro
  - `diffbro`

- Implement the feedback from diffbro

- Commit your code with confidence

### Compare branch changes

- Before you merge, run diffbro
  - `diffbro --peer-review main`

- Implement the feedback from diffbro

- Merge your code with confidence

## Development

#### Install bleeding edge version test version

- Install BLEEDING EDGE version from [TestPyPi](https://test.pypi.org/)
  - `pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple diffbro`

#### Local Dev Commands (excluded from dist)
- run diffbro locally
  - `poetry run diffbro`
- test versions
  - `poetry run python scripts/run_tox.py`
- publish to test pypi
  - `poetry run python scripts/publish_testpypi.py`
- publish to pypi
  - `poetry run python scripts/publish_pypi.py`

## ROADMAP

[✅] POC

[✅] Add GPT model flag

[✅] Add diff exclusion of large files like poetry.lock from the diff

  [✅] Add cli --only flag to diff only specific file types

  [✅] Add cli --ignore flag to ignore specific file types

[✅] Deploy version 0.1.0 to TestPyPi

[✅] Test install version 0.1.0 from TestPyPi

[✅] Deploy version 0.1.2 to pypy

[✅] Add help docs

[✅] Support additional python versions

[✅] Improve openai_api_key check

[✅] Chad should always ask to use gpt-4 (simple yes/no prompt)

[✅] Add custom prompt flag to be run on the diff
  `diffbro --prompt "Below is a git diff of code. Please review and notify only of critical issues."`

[✅] Add summarybro flag that will create a git commit message using the diffbro summary
  `diffbro --summarize` -> "Added new feature to the app, fixed a bug, and refactored some code."

[✅] Add COMPLETE PR review flag which runs diffbro against a branch and creates a PR review
  `diffbro --pr main`

[✅] RELEASE VERSION 1.0.0!!!

[] Parallelize diffbro and commit summary GPT requests

[] Add unit tests

[] What feature would you like to see next? [Submit a feature request](https://github.com/disler/diffbro/issues/new)

[?] Add token limit check to prevent overage charges

[?] Add 'AI Devlogs' section to readme w/links to ai devlogs

[?] Add ~/.diffbro config file support for custom defaults
  - if a cli param was specified in the .diffbro file, use that. Add default values to argparse to detect if a cli param was specified (dirty)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/disler/diffbro.git",
    "name": "diffbro",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "IndyDevDan",
    "author_email": "minor7addfloortom@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4e/89/b1f1574a722ef31f62d5cdab664db960bbfa740de4639ee0196377729953/diffbro-1.0.2.tar.gz",
    "platform": null,
    "description": "# diffbro - AI Powered Peer Reviews\n\n*Your AI Peer Review Bro*\n\nDiffbro is a command line tool that gives you AI powered peer reviews on your codebase. Under the hood diffbro utilizes `git diff` and OpenAI's *GPT-3.5-turbo* and *GPT-4* to review your code and provide feedback on your changes. \n\nDiffbro is best used before you stage and commit your code to your codebase. Diffbro also supports full branch diff PR feedback as if it were an engineer reviewing your merge request (see `--peer-review` flag). Diffbro is designed to help you catch bugs, improve your code quality, and help you ship with confidence.\n\n![Diffbro Header](https://firebasestorage.googleapis.com/v0/b/solopreneur-d8361.appspot.com/o/Diffbro%2Fdiffbro.jpg?alt=media&token=fefc8d90-10e2-4091-9b03-957af25aee3b)\n\n## Features\n\n- View all commands, options and examples\n  - `diffbro --help`\n\n- Run against local changes\n  - `diffbro`\n\n- Run diffbro against a branch and create a PR review\n  - `diffbro --peer-review main`\n\n- Different bro modes for chill, to chad engineer level peer reviews\n  - chill: will review your code like a chill bro (default)\n    - `diffbro --chill`\n  - mid: will review your code like a mid level engineer bro\n    - `diffbro --mid`\n  - chad: will review your code like a chad, staff engineer bro\n    - `diffbro --chad`\n\n- Choose which files to review\n  - Only .py and .js files\n    - `diffbro --only .py .js`\n  - Everything except .py and .js files\n    - `diffbro --ignore .py .js`\n  - *Defaults to [\".py\", \".c\", \".cpp\", \".java\", \".cs\", \".php\", \".vb\", \".html\", \".css\", \".js\", \".ts\", \".asp\", \".aspx\", \".cfm\", \".cgi\", \".pl\", \".cer\", \".htm\", \".xhtml\", \".shtml\", \".jsp\", \".jsx\", \".tsx\", \".vue\", \".solid\", \".toml\", \".md\", \".go\", \".rs\", \".swift\"]*\n\n- Choose your gpt model\n  - `diffbro --model gpt-3.5-turbo`\n  - `diffbro --model gpt-4` (default) (recommended for production code)\n\n- Summarize the git diff for a commit message or PR description\n  - `diffbro --summarize`\n\n- Override the default prompts with your own custom prompt\n  - `diffbro --prompt \"Below is a git diff of code. Please review and notify only of critical issues. If there are no critical issues, respond with tons of checkbox emojis\"`\n\n- Example command combos\n  - '*I want a chill review on my .py and .js files*'\n    - `diffbro --chill --only .py .js`\n  - '*I'm about to ship production, mission critical UI code, I need a hardcore review on my FE code*'\n    - `diffbro --chad --model gpt-4 --only .js .jsx .tsx .vue`\n  - '*I'm about to a fullstack app and need a comprehensive mid level review on all my code excluding .tsx files*'\n    - `diffbro --mid --model gpt-4 --ignore .tsx`\n  - '*I want to run my own prompt against my git diff with a summary for the commit massage*'\n    - `diffbro --prompt \"Below is a git diff of code. Please review and notify only of critical issues.\" --summarize`\n  - '*I want a quick comparison of my changes against the staging branch with a summary*'\n    - `diffbro --peer-review staging --model gpt-3.5-turbo --summarize`\n  - '*I want a mid level code review of all of my .ts files*'\n    - `diffbro --mid --only .ts`\n  - '*I want top tier code reviews all the time*'\n    - Throw this line into your `.bashrc` or `.bash_profile`\n      - `alias dbro=\"diffbro --chad --model gpt-4 --summarize\"`\n    - Then, whenever you want a review, just run\n      - `dbro`\n\n## Install & Use\n\n- Install or switch to [Python 3.11 or 3.10 or 3.9 or 3.8](https://www.python.org/downloads/)\n  - Check your python version\n    - `python --version`\n\n- Install '*stable*' version from [PyPI](https://pypi.org/)\n  - `pip install --upgrade diffbro`\n\n- Export your openai api key\n  - `export OPENAI_API_KEY=<your-openai-api-key>`\n\n- Make changes to your codebase\n\n- Run diffbro\n  - `diffbro`\n\n### Compare local changes\n\n- Before you stage and commit, run diffbro\n  - `diffbro`\n\n- Implement the feedback from diffbro\n\n- Commit your code with confidence\n\n### Compare branch changes\n\n- Before you merge, run diffbro\n  - `diffbro --peer-review main`\n\n- Implement the feedback from diffbro\n\n- Merge your code with confidence\n\n## Development\n\n#### Install bleeding edge version test version\n\n- Install BLEEDING EDGE version from [TestPyPi](https://test.pypi.org/)\n  - `pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple diffbro`\n\n#### Local Dev Commands (excluded from dist)\n- run diffbro locally\n  - `poetry run diffbro`\n- test versions\n  - `poetry run python scripts/run_tox.py`\n- publish to test pypi\n  - `poetry run python scripts/publish_testpypi.py`\n- publish to pypi\n  - `poetry run python scripts/publish_pypi.py`\n\n## ROADMAP\n\n[\u2705] POC\n\n[\u2705] Add GPT model flag\n\n[\u2705] Add diff exclusion of large files like poetry.lock from the diff\n\n  [\u2705] Add cli --only flag to diff only specific file types\n\n  [\u2705] Add cli --ignore flag to ignore specific file types\n\n[\u2705] Deploy version 0.1.0 to TestPyPi\n\n[\u2705] Test install version 0.1.0 from TestPyPi\n\n[\u2705] Deploy version 0.1.2 to pypy\n\n[\u2705] Add help docs\n\n[\u2705] Support additional python versions\n\n[\u2705] Improve openai_api_key check\n\n[\u2705] Chad should always ask to use gpt-4 (simple yes/no prompt)\n\n[\u2705] Add custom prompt flag to be run on the diff\n  `diffbro --prompt \"Below is a git diff of code. Please review and notify only of critical issues.\"`\n\n[\u2705] Add summarybro flag that will create a git commit message using the diffbro summary\n  `diffbro --summarize` -> \"Added new feature to the app, fixed a bug, and refactored some code.\"\n\n[\u2705] Add COMPLETE PR review flag which runs diffbro against a branch and creates a PR review\n  `diffbro --pr main`\n\n[\u2705] RELEASE VERSION 1.0.0!!!\n\n[] Parallelize diffbro and commit summary GPT requests\n\n[] Add unit tests\n\n[] What feature would you like to see next? [Submit a feature request](https://github.com/disler/diffbro/issues/new)\n\n[?] Add token limit check to prevent overage charges\n\n[?] Add 'AI Devlogs' section to readme w/links to ai devlogs\n\n[?] Add ~/.diffbro config file support for custom defaults\n  - if a cli param was specified in the .diffbro file, use that. Add default values to argparse to detect if a cli param was specified (dirty)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Your personal AI assistant bro for better code reviews.",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/disler/diffbro.git",
        "Repository": "https://github.com/disler/diffbro.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77c5c5e195e5b8eef55cd16c8295304019971f95dbad402054d1a1dd120df891",
                "md5": "625e5b575596453b44cb1c71d18f8fd8",
                "sha256": "198b3b834d1d08ea6f43f78efac2bdccc16af6aa5ed36ec30eea588a0931ae68"
            },
            "downloads": -1,
            "filename": "diffbro-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "625e5b575596453b44cb1c71d18f8fd8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 9200,
            "upload_time": "2023-09-04T17:29:03",
            "upload_time_iso_8601": "2023-09-04T17:29:03.765559Z",
            "url": "https://files.pythonhosted.org/packages/77/c5/c5e195e5b8eef55cd16c8295304019971f95dbad402054d1a1dd120df891/diffbro-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e89b1f1574a722ef31f62d5cdab664db960bbfa740de4639ee0196377729953",
                "md5": "c4c2344f48e7ad536d9ac1a248b32e36",
                "sha256": "a39147757c95ac9c5c5a44b452cc2d4dcc902fea0c848b5ebd609afe76d99c95"
            },
            "downloads": -1,
            "filename": "diffbro-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c4c2344f48e7ad536d9ac1a248b32e36",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 9101,
            "upload_time": "2023-09-04T17:29:04",
            "upload_time_iso_8601": "2023-09-04T17:29:04.721827Z",
            "url": "https://files.pythonhosted.org/packages/4e/89/b1f1574a722ef31f62d5cdab664db960bbfa740de4639ee0196377729953/diffbro-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-04 17:29:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "disler",
    "github_project": "diffbro",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "diffbro"
}
        
Elapsed time: 0.15928s