AI Search Prompt for VS Code

Transform natural language descriptions into powerful search queries using AI. This extension adds an AI-powered prompt field to the VS Code Search panel, making it easier to find exactly what you're looking for.
Features
- Natural Language Search: Describe what you're looking for in plain English
- Smart Query Generation: AI converts your description into an optimized search query
- Automatic Search Options: Automatically configures regex, case sensitivity, and whole word matching based on your prompt
- Seamless Integration: Works directly within VS Code's existing Search panel
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "AI Search Prompt"
- Click Install
Alternatively, you can install the VSIX file directly:
- Download the .vsix file from the latest release
- In VS Code, go to Extensions
- Click the "..." menu in the top-right of the Extensions panel
- Select "Install from VSIX..." and choose the downloaded file
Usage
- Open the Search panel (Ctrl+Shift+F / Cmd+Shift+F)
- You'll see a new "Generate" toolbar button
- Enter your search description in natural language
- Press Enter
- The AI will generate and apply an appropriate search query
Example Prompts
- "Find functions that handle user authentication"
- "Look for TODO comments that mention database connections"
- "Search for case sensitive occurrences of API_KEY"
- "Find regex patterns that validate email addresses"
- "Look for whole word matches of 'data' in JavaScript files"
Configuration
Set up your AI service API key in the extension settings:
- Go to Settings (Ctrl+, / Cmd+,)
- Search for "AI Search Prompt"
- Enter your API key
{
"aiSearchPrompt.apiKey": "your-api-key-here",
"aiSearchPrompt.apiEndpoint": "https://api.openai.com/v1/chat/completions",
"aiSearchPrompt.modelId": "gpt-4o",
}
Requirements
- VS Code 1.60.0 or later
- Internet connection (for AI service API calls)
- API key for the AI service (OpenAI by default)
How It Works
When you submit a prompt:
- The extension sends your natural language prompt to an AI model
- The AI analyzes your intent and generates a search configuration
- The extension applies this configuration to VS Code's search functionality
- The search results appear just as they would with a manual search
Privacy & Security
Your search prompts are sent to the configured AI service. No other VS Code or workspace data is transmitted. Your API key is stored in VS Code's secure storage and is only used for communicating with the AI service.
Known Issues
- Some highly technical or domain-specific terminology might not be interpreted correctly
Release Notes
0.0.1
- Initial release
- Basic prompt-to-search functionality
- Integration with VS Code Search panel
- Support for case sensitivity, regex, and whole word options
Contributing
Contributions are welcome! Check out the contribution guidelines for more information.
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request
License
This extension is licensed under the MIT License.
Acknowledgements
- VS Code Extension API
- OpenAI for providing the AI backend capabilities
Enjoy searching smarter, not harder!
*Extension mostly generated by LLM