I have extended Pipet-code-agent to build an AI code assistant with adding a new feature/command for generating well-formatted GitHub README documents in Markdown based on selected code snippets. The Pipet Code Agent is a Visual Studio Code extension developed by Google that leverages the power of the Google Gemini API to assist developers by generating comments and reviews for selected code.
The new command added to this extension allows you to generate a well-structured GitHub README document in Markdown based on the code selected in the editor. The README includes appropriate headers, descriptions, code examples, and other relevant Markdown formatting.
Install the Pipet Code Agent Extension
Since the extension is not yet published on the VS Code Marketplace, you can test it locally by following these steps:
Install Dependencies
Install the required Node.js dependencies using npm.
npm install
Run the Extension in Debug Mode
Open the project in Visual Studio Code and start debugging to run the extension in an Extension Development Host window.
npm run vscode:prepublish
Configure API Key
Set up your Google Gemini API key in the VS Code settings.
// settings.json
{
"google.gemini.apiKey": "your-api-key-here"
}
Use the Markdown README Generator Command
Ctrl+Shift+P
or Cmd+Shift+P
).Pipet: Create README from Selected Text
and select the command.Generated README Example
Here is an example of a generated README based on a selected code snippet:
# API Key Loader
This script attempts to load the API key from the environment.
## Features
- Securely load API keys
- Easy to integrate
## Example Usage
```python
api_key = os.getenv("GOOGLE_API_KEY")
Contributions to this extension are welcome! If you have suggestions for improvements or new features, feel free to open an issue or create a pull request on the Pipet Markdown Agent GitHub repository.
This project is licensed under the Apache 2.0 License.