The AI-powered command line tool for working with legacy code. Designed based on the principles of the Mechanized Mending Manifesto.
Menderbot is usable in development of itself - a very small codebase. For instance, it's used on this project for first drafts of commit messages, it added most of the type annotations, and chat usually gives relevant answers. On codebases of an interesting size (> 10K lines) there is still much work to do.
menderbot ask
: Ask a question about the codebasemenderbot chat
: Interactively chat about the codebasemenderbot commit
: Git commit the current changeset with a pre-populated commit messagemenderbot diff
: Summarize the differences between two versions of a codebasemenderbot doc
: Generate documentation for the existing code (Python only)menderbot review
: Review a code block or changeset and provide feedbackmenderbot type
: Insert type hints (Python only)menderbot ingest
: Index the current state of the repo forask
andchat
commandsmenderbot check
: Verify we have what we need to run
- Python 3.10+
- The environment variable
OPENAI_API_KEY
set to a valid OpenAI API Key. - git
- Make (you already have it)
Clone the project and install an editable version (this uses python3 -m pip install -e .
):
git clone [email protected]:craftvscruft/menderbot.git
make install
You can also install directly from pip and avoid cloning the repo:
pip install menderbot --upgrade
You can run with menderbot
in any repo. It's a good idea to start by running the check
command to make sure we have what we need. For instance we will need to supply the OPENAI_API_KEY environment variable and a ``.menderbot-config.yaml` file indicating consent.
menderbot check
If you don't have Python, you can run from Docker using the supplied Dockerfile. Run make docker
to build the image and print instructions on how to run it.
Clone the project...
git clone [email protected]:craftvscruft/menderbot.git
Then you can initialize your Python environment using venv.
make venv
source venv/bin/activate
pip install "." ".[dev]"
If you want to re-generate the Antlr parsers, see PARSERS.md, but you probably won't need to.
Formatting, linting, tests, and type-checking can all be run with make, check the Makefile
for the underlying commands. Run before commiting, or CI will bark :)
# Same as `make test type lint format`
make check
Or you can run individual steps if you prefer:
# Run pytest
make test
# Run pytest with a coverage report
make coverage
# Run mypy
make type
# Run pylint
make lint
# Run black and isort
make format
👤 Ray Myers
- YouTube: Craft vs Cruft
- Twitter: @lambdapocalypse
- GitHub: @raymyers
- LinkedIn: @cadrlife
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
- OpenAI GPT and Ada models
- LlamaIndex, an LLM data framework
- Antlr parser generator
Copyright © 2024 Ray Myers.
This project is Apache 2 licensed.