VsCode Mama is an AI-driven VS Code extension designed to enhance, refactor, and optimize your code effortlessly. Supporting various Large Language Models (LLMs) like OpenAI, Claude.ai, and Ollama's Llama 3.2, this tool enables production-level code improvements and documentation with just a few clicks or shortcuts.
- Supports Multiple LLMs: Choose between OpenAI, Claude.ai, and Ollama (Llama 3.2).
- Code Refactoring and Optimization: Refactor entire files or highlighted sections for targeted improvements.
- Customizable API Key Integration: Easily add your own API keys for OpenAI and Claude.ai.
- Quick Model Switching: Reset configuration and seamlessly switch between LLMs as needed.
-
Download and Install Ollama (Llama 3.2)
For Llama, download from Ollama's site and follow the instructions to install Llama 3.2 locally. -
Install VsCode Mama Extension
- Visit mammagonnacleanyocode.co to learn more about the extension and download it.
- Alternatively, open VS Code, go to the Extensions panel, and search for "VsCode Mama" to install it directly.
-
Activate the Extension
Run the shortcutCommand + Control + S
or search "VsCode Mama" in the command palette. -
Select Your Preferred Model
Upon first use, a popup will appear with three model options:- OpenAI: Requires an API key. Obtain it from OpenAI's API Key Page.
- Claude.ai: Requires an API key. Obtain it from Claude's API Key Page.
- Ollama (Llama 3.2): Works locally; ensure you’ve downloaded and installed it from here.
-
Enter API Keys
After selecting OpenAI or Claude.ai, you will be prompted to enter your API key.
-
Refactor Code
- Run the shortcut
Command + Control + S
on the current file, or select a specific code section and run the shortcut to refactor only that part. - The LLM will optimize, clean up, and add comments to your code as needed.
- Run the shortcut
-
Switch Models
- To reset and choose a different LLM, run
VsCode Mama: Reset Configuration
from the command palette. You will be guided through selecting a new model and re-entering API keys if necessary.
- To reset and choose a different LLM, run
- Supported LLMs
- OpenAI: Integrate by obtaining an API key from OpenAI's platform.
- Claude.ai: Integrate with Claude.ai’s key for flexible AI-based optimizations.
- Ollama (Llama 3.2): Run locally; no API key required, but Llama 3.2 must be installed on your device.
This project is licensed under the MIT License - see the LICENSE file for details.