Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 20 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
npm-debug.log
Thumbs.db
**/node_modules/
*/out/
*/.vs/
tsconfig.lsif.json
*.lsif
*.db
*.tsbuildinfo
out
5 changes: 5 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"r.lsp.promptToInstall": false
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
11 changes: 11 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

All notable changes to the "vscode-momma" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [Unreleased]

- Initial release
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# VsCode Mama: AI-Powered Code Optimization Extension

**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.

## ✨ Features

- **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.

## 🚀 Getting Started

### Installation

1. **Download and Install Ollama (Llama 3.2)**
For Llama, download from [Ollama's site](https://ollama.com/download) and follow the instructions to install Llama 3.2 locally.

2. **Install VsCode Mama Extension**
- Visit [mammagonnacleanyocode.co](https://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.

### Initial Setup

1. **Activate the Extension**
Run the shortcut `Command + Control + S` or search "VsCode Mama" in the command palette.

2. **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](https://platform.openai.com/api-keys).
- **Claude.ai**: Requires an API key. Obtain it from [Claude's API Key Page](https://console.anthropic.com/settings/keys).
- **Ollama (Llama 3.2)**: Works locally; ensure you’ve downloaded and installed it from [here](https://ollama.com/download).

3. **Enter API Keys**
After selecting OpenAI or Claude.ai, you will be prompted to enter your API key.

## 🛠 Usage

1. **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.

2. **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.

## 📚 Documentation

- **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.

## 📝 License

This project is licensed under the MIT License - see the LICENSE file for details.
28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [{
files: ["**/*.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},

rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],

curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "warn",
},
}];
Loading