Skip to main content

Menderbot

Version Tests License: APACHE

The AI-powered command line tool for working with legacy code. Designed based on the principles of the Mechanized Mending Manifesto.

Status

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.

Commands implemented (-ish):

  • menderbot ask: Ask a question about the codebase
  • menderbot chat: Interactively chat about the codebase
  • menderbot commit: Git commit the current changeset with a pre-populated commit message
  • menderbot diff: Summarize the differences between two versions of a codebase
  • menderbot doc: Generate documentation for the existing code (Python only)
  • menderbot review: Review a code block or changeset and provide feedback
  • menderbot type: Insert type hints (Python only)
  • menderbot ingest: Index the current state of the repo for ask and chat commands
  • menderbot check: Verify we have what we need to run

System requirements

  • git
  • Python 3.9+
  • Make (you already have it)
  • The environment variable OPENAI_API_KEY set to a valid OpenAI API Key.

Running

Clone the project...

Install an editable version (this uses pip install -e .):

git clone git@github.com:craftvscruft/menderbot.git

make install

Then run with menderbot in any repo.

Installing from pip

You can also install directly from pip and avoid cloning the repo:

pip install menderbot --upgrade

Running with Docker

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.

Developing

Clone the project...

git clone git@github.com: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.

Testing

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 :)

make check

Or you can run individual steps

# 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

Author

👤 Ray Myers

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

Acknowledgements

📝 License

Copyright © 2023 Ray Myers.

This project is Apache 2 licensed.

Metadata

Release files for menderbot 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for menderbot 0.0.4
File Size Uploaded Provenance Actions
menderbot-0.0.4.tar.gz 72.3 kB Without provenance Details for menderbot-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for menderbot 0.0.4
File Interpreter ABI Platform Actions
menderbot-0.0.4-py3-none-any.whl Python 3 none any Details for menderbot-0.0.4-py3-none-any.whl

Total release size: 142.6 kB

Release files / menderbot-0.0.4.tar.gz

Download URL menderbot-0.0.4.tar.gz
Size 72.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e1f0059613b8a8149cf8ab272af01f8a21a40f38e0288c199e892564527d30a1
BLAKE2b-256 checksum
How to use checksums
5c75b6743709ac20bbdfc00ef274b30afa3fbc8364d3466ae6aeb43d639e97f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / menderbot-0.0.4-py3-none-any.whl

Download URL menderbot-0.0.4-py3-none-any.whl
Size 70.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c0cf622e6ddb91114729e8de6c65babd6ae4e3fd8ed38b9377907fb97541dc6
BLAKE2b-256 checksum
How to use checksums
e64cf4cd5914b304007ade82e202612dc4db71747c34d29b840c16ab9aa06158
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for menderbot 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page