Overview Version History Q & A Rating & Review
FreeAgent - AI Code Assistant
FreeAgent is a VS Code extension that leverages Google's Gemini AI to provide intelligent code assistance. It helps developers understand, improve, and maintain their code through natural language interactions.
Installation
You can install FreeAgent from the VS Code Marketplace:
Features
Code Analysis
Explain Code : Get detailed explanations of selected code
Refactor Code : Receive suggestions for code improvements
Summarize Code : Get high-level overview of code functionality
Find Bugs : Identify potential issues and bugs
Document Code : Generate documentation for your code
Analyze Performance : Get insights into code performance and optimization opportunities
Smart Chat Interface
Interactive chat with context-aware responses
Code-aware conversations that understand your workspace
Support for multiple Gemini models
Real-time code suggestions and explanations
Syntax-highlighted code blocks
Chat history management
Requirements
Visual Studio Code version 1.80.0 or higher
A Google Gemini API key (get one from Google AI Studio )
Setup
Install the extension from the VS Code Marketplace
Set your Gemini API key:
Open Command Palette (Cmd/Ctrl+Shift+P)
Type "FreeAgent: Set API Key"
Enter your API key when prompted
Usage
Select code in your editor
Right-click and choose one of the FreeAgent commands:
"FreeAgent > Explain Code"
"FreeAgent > Refactor Code"
"FreeAgent > Summarize Code"
"FreeAgent > Find Bugs"
"FreeAgent > Document Code"
"FreeAgent > Analyze Performance"
Alternatively, use the Command Palette (Cmd/Ctrl+Shift+P) and type "FreeAgent:" to see all available commands.
Chat Interface Features
Model Selection : Choose between different Gemini models
Clear Chat : Reset your conversation at any time
Code Context : Automatically includes relevant file and line information
Error Handling : Clear feedback for API issues or rate limits
Markdown Support : Rich text formatting including code blocks
Git Integration : Shows your Git username in chat
Extension Settings
This extension contributes the following settings:
freeagent.apiKey
: Your Gemini API key
freeagent.model
: The Gemini model to use (default: 'gemini-1.5-pro')
freeagent.apiBaseUrl
: The API base URL (default: 'https://generativelanguage.googleapis.com/v1beta')
freeagent.enableDebugLogs
: Enable debug logging for troubleshooting (default: false)
Enabling Debug Logs
To enable debug logging for troubleshooting:
Open VS Code Settings (Cmd/Ctrl+,)
Search for "FreeAgent"
Check the "Enable Debug Logs" option
Or add "freeagent.enableDebugLogs": true
to your settings.json
Open the Output panel (View > Output)
Select "FreeAgent" from the dropdown menu
Debug logs will show:
Service initialization details
Configuration loading
API requests and responses
Chat message handling
Error details and stack traces
This is useful when:
Troubleshooting API issues
Debugging model responses
Understanding chat context flow
Investigating performance problems
Error Messages
Common error messages and how to resolve them:
API Key Error : Check your API key in settings
Network Error : Check your internet connection
Rate Limit : Wait a moment and try again
Model Error : Try a different model
Quota Error : Check your API usage limits
Architecture
For detailed technical information about the extension's architecture, please see ARCHITECTURE.md .
Contributing
Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature
)
Commit your changes (git commit -m 'feat: add amazing feature'
)
Push to the branch (git push origin feature/amazing-feature
)
Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Google Gemini AI for providing the underlying AI capabilities
VS Code Extension API for enabling rich integration
All contributors who have helped improve this extension