Collab AI Searchbar is a powerful Visual Studio Code extension that integrates OpenAI's GPT models into your coding environment. It provides an intuitive chat interface and context-aware code actions to enhance your development workflow. With features like code explanation, refactoring, and documentation, it’s designed to streamline your coding experience directly within VSCode.
🚀 Features
🔑 Secure Authentication:
Sign up with your email and webhook URLs to securely store session data.
Uses JWT-based session tokens to manage authentication and API keys.
💬 Interactive Sidebar Chat:
Ask coding questions or get assistance directly from the sidebar.
Supports multi-turn conversations with chat history.
🖱️ Right-Click Code Actions:
💡 Explain Selection: Get detailed explanations of selected code.
🔧 Refactor Code: Automatically refactor selected code for improved readability and performance.
📃 Document Selection: Generate professional documentation for your code, including summaries, inline comments, and docstrings.
📋 Apply Code: Seamlessly apply AI-generated code to your active editor with proper indentation.
🧠 Powered by OpenAI:
Leverages gpt-4o-mini for intelligent code analysis and generation.
📊 Usage Tracking:
Configurable prompt threshold to track and reset usage via a webhook.
🖼️ Responsive UI:
Clean, modern chat interface with support for code blocks and an "Apply Code" button.
Displays typing indicators for a smooth user experience.
🔒 Secure Storage:
Stores sensitive data like session tokens and API keys securely in VSCode’s global state.
🛠️ Installation
Install the extension from the VSCode Marketplace(or sideload the .vsix file for local testing).
Upon activation, the ChatGPT Searchbar panel will appear in the sidebar.
Complete the setup by providing:
✉️ Email Address: For user identification.
🌐 Signup Webhook URL: Backend URL for user signup.
📊 Track Usage Webhook URL: Backend URL for tracking prompt and token usage.
⚠️ Prompt Threshold: Number of prompts before usage is reported and reset.
Click Submit to authenticate and start using the extension.
💡 Usage
🗨️ Sidebar Chat
Open the ChatGPT Searchbar view from the VSCode sidebar.
Type your coding question or prompt in the input box.
Receive responses with formatted code blocks and an option to apply code directly to your editor.
🖱️ Right-Click Code Actions
Select a block of code in any editor.
Right-click and choose one of the following:
💡 Explain Selection: Get a detailed breakdown of what the selected code does.
🔧 Refactor Code: Request AI-driven refactoring suggestions for cleaner, more efficient code.
📃 Document Selection: Generate comprehensive documentation, including high-level summaries, inline comments, and docstrings.
Use the Apply Code button in the chat response to insert AI-generated code into your editor.
🔑 Logout
Use the chatgpt-searchbar.logout command to clear your session and log out securely.
🧩 Settings
Setting
Description
chatgptSessionToken
Stores the JWT session token for authentication.
chatgptEmail
Stores the user’s email address.
chatgptApiKey
Stores the OpenAI API key securely.
backendSignupUrl
URL for the signup webhook.
backendTrackUsageUrl
URL for tracking prompt usage.
promptThreshold
Number of prompts before usage is reported and reset.
promptCount
Tracks the current number of prompts sent.
Sure! Here's an updated version of the document:
🛠 Supported Models
gpt-4o-mini(default model for all AI interactions)
40(available from July 2024)
40-mini(available from July 2024)
🧑💻 Contributing
Interested in contributing? Feel free to:
Open an issue to report bugs or suggest features.
Fork the repository and submit a pull request with your improvements.