Skip to main content

AI coding assistant on your command line

Project description

Twitter Follow Discord Follow Stable Version License

🧙‍♂️ Mentat ⚡

It is by will alone I set my mind in motion

The Mentat Mantra

The Mentats of Dune combine human creativity with computer-like processing - and now you can too.


Mentat is the AI tool that assists you with any coding task, right from your command line.

Unlike Copilot, Mentat coordinates edits across multiple locations and files. And unlike ChatGPT, Mentat already has the context of your project - no copy and pasting required!

Want help understanding a new codebase? Need to add a new feature? Refactor existing code? Mentat can do it!

🍿 Example Videos (🔊 on!)

https://github.com/biobootloader/mentat/assets/128252497/35b027a9-d639-452c-a53c-ef019a645719

See more videos on Twitter or YouTube:

⚙️ Setup

Install

Before installing, it's suggested that you create a virtual environment to install it in:

# Python 3.10 or higher is required
python3 -m venv .venv
source .venv/bin/activate

Note that you'll have to have activated the virtual environment to run mentat if you install it there.

There are then 3 install methods. The first two will just let you run it:

  • PyPI: python -m pip install mentat-ai
  • Github: python -m pip install git+https://github.com/biobootloader/mentat.git

The third option is useful if you'd also like to modify Mentat's code, as well as run it:

git clone https://github.com/biobootloader/mentat.git
cd mentat

# install with pip in editable mode:
pip install -e .

Add your OpenAI API Key

You'll need to have API access to GPT-4 to run Mentat. There are a few options to provide Mentat with your OpenAI API key:

  1. Create a .env file with the line OPENAI_API_KEY=<your-api-key> in the directory you plan to run mentat in or in ~/.mentat/.env
  2. Run export OPENAI_API_KEY=<your key here> prior to running Mentat
  3. Place the previous command in your .bashrc or .zshrc to export your key on every terminal startup

Configuration

For custom configuration options see configuration.md

🚀 Usage

Run Mentat with:

mentat <paths to files or directories>

If you provide a directory, Mentat will add all non-hidden text files in that directory to it's context. If this exceeds the GPT-4 token context limit, try running Mentat with just the files you need it to see.

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

mentat-ai-0.1.6.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

mentat_ai-0.1.6-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file mentat-ai-0.1.6.tar.gz.

File metadata

  • Download URL: mentat-ai-0.1.6.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for mentat-ai-0.1.6.tar.gz
Algorithm Hash digest
SHA256 09f2e6fc594725b459cee21d28510c6e9a21be281a69c8f262456697d1b35642
MD5 56a4715f5c1035436eacc16d6ffb77eb
BLAKE2b-256 4b98dca6e52ddde5abe422dd0bb54d5d6043512e4b5fd9a472a147ef3ea647c5

See more details on using hashes here.

File details

Details for the file mentat_ai-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: mentat_ai-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for mentat_ai-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 46651f2c872b2271fa5521e4ab57e32ce5f6996d527d6988958b8ccf12d98722
MD5 527967a1e6088726a1a4f7b947c4cfb2
BLAKE2b-256 144ddff4648f8832bef9bfbf57c458f52229e9a7b25e244b5269966f1fd49038

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page