(created with Parroty)
Parroty is an innovative Visual Studio Code extension designed to streamline the documentation process for developers. Leveraging the power of Google's Generative AI (Gemini), Parroty acts as an intelligent assistant that helps you generate various forms of documentation directly within your VS Code environment. Whether you need quick code comments, comprehensive function docstrings, or even an initial README.md for your project, Parroty aims to reduce the manual effort involved in keeping your codebase well-documented and understandable.
Visual Studio Code Marketplace: Click Here.
To get a local copy of Parroty up and running, follow these steps. This project consists of a Python backend that interacts with the AI model and a TypeScript-based VS Code extension.
Ensure you have the following software installed on your system:
- Node.js & npm: For building and running the VS Code extension.
- LTS version recommended. You can download it from nodejs.org.
- Verify installation:
- bash
node -vnpm -v
- Python 3.8+ & pip: For the AI backend.
- Download from python.org.
- Verify installation:
- bash
python3 -Vpip3 -V
- Visual Studio Code: The editor for which this extension is developed.
- Download from code.visualstudio.com.
- Google Gemini API Key: Parroty uses the Google Gemini API.
- Obtain a free API key from Google AI Studio.
-
Clone the repository:
git clone https://github.com/DouglasC2627/parroty.gitcd parroty
-
Run the setup script:
- The project includes a
setup.shscript to automate the installation of dependencies for both the backend and the extension.
chmod +x setup.sh./setup.sh: This script will attempt to set up a Python virtual environment for the backend and install Node.js dependencies for the extension.
- The project includes a
-
Manual Installation (if
setup.shfails or for detailed control):- Backend Setup:
- Navigate to the
extension/backenddirectory, create a virtual environment, activate it, and install Python dependencies:cd extension/backendpython3 -m venv venvsource venv/bin/activate# On Windows, use.\venv\Scripts\activatepip install -r requirements.txtcd ..# Go back to the root directory
- Navigate to the
- VS Code Extension Setup:
- Navigate to the
extensiondirectory and install Node.js dependencies:cd extensionnpm installnpm run compile# This builds the extension's JavaScript filescd ..# Go back to the root directory
- Navigate to the
- Backend Setup:
Once installed, you can launch and use the Parroty extension within VS Code.
-
Open the Project in VS Code: Open the root
parrotyfolder in Visual Studio Code. -
Configure Gemini API Key: The extension requires your Google Gemini API key to function.
- Open VS Code Settings (
File > Preferences > SettingsorCode > Preferences > Settingson macOS, orCtrl+,/Cmd+,). - Search for "Parroty".
- Locate the
Parroty: Gemini Api Keysetting and paste your Google Gemini API key into the input field.
- Open VS Code Settings (
-
Run the Extension (for development): If you are running from source for development:
- Go to the Run and Debug view (
Ctrl+Shift+DorCmd+Shift+D). - Select "Run Extension" from the dropdown at the top.
- Click the green play button. This will launch a new VS Code window (Extension Development Host) with the Parroty extension activated.
- Go to the Run and Debug view (
-
Using the AI Documentation Assistant:
-
Generate Comment:
- Select a block of code (function, class, or a few lines) in your active editor.
- Right-click on the selection.
- Choose "Parroty > Generate Comment" from the context menu.
- The AI will generate a comment or a brief explanation for the selected code.
-
Generate Docstring:
- Place your cursor inside a function or class definition.
- Right-click.
- Choose "Parroty > Generate Docstring".
- The AI will attempt to generate a suitable docstring for the selected code element.
-
Generate
README.md:- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P). - Type "Parroty" and select "Parroty > Generate README.md".
- The extension will analyze your open project and generate a draft
README.mdfile based on its understanding of the project structure and content. This will be created in your project's root directory.
- Open the Command Palette (
-
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request