🔍 Instantly discover code with AI-powered semantic search
A powerful VS Code extension that revolutionizes how you navigate Python codebases using natural language queries
OwlSpotlight transforms code navigation by bringing semantic understanding to your VS Code workspace. Instead of searching for exact matches, ask questions like "function that validates email" or "class for handling database connections" and instantly find relevant code across your entire Python project.
Instantly discover code with semantic search. A VS Code extension for searching Python functions, classes, and methods using natural language.
意味的検索でPython関数・クラス・メソッドを瞬時に発見できるVS Code拡張機能。
- AI-powered semantic search – Find code by intent, not just keywords
- Fast search and incremental indexing
- Search functions, classes, methods, and their relationships
- Results ranked by relevance
- Only changed files are re-indexed
- Simple, intuitive sidebar interface
- Apple Silicon optimized
- CUDA/GPU acceleration supported
- Built-in cache clearing and environment management
- Customizable SentenceTransformer model via settings
Prerequisites: Python 3.9+ installed on your system
Note: Queries can be entered in English or Japanese. Japanese text will be automatically translated to English when the feature is enabled in the settings.
- Open this project in VS Code
- Setup environment - Open Command Palette (
Cmd+Shift+P
) and run:OwlSpotlight: Setup Python Environment
- Start the server:
OwlSpotlight: Start Server
- Start searching! Open the OwlSpotlight sidebar and enter your query
-
Build the extension:
npm install npm run compile npx vsce package
-
Install in VS Code:
- Open Command Palette (
Cmd+Shift+P
) - Select
Extensions: Install from VSIX...
- Choose the generated
.vsix
file
- Open Command Palette (
-
Setup Python environment:
cd model_server python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt
-
Launch: Run the commands from Option 1, steps 2-4
Traditional Search | OwlSpotlight |
---|---|
def email_validation |
"function that validates email addresses" |
class Database |
"class for database connections" |
Exact keyword matching | Sem 8000 antic understanding of code purpose |
Limited to function names | Searches documentation, comments, and logic |
Component | Requirement | Notes |
---|---|---|
Python | 3.9+ (3.11 recommended) | Virtual environment recommended |
Memory | 4GB+ (8GB+ for large projects) | More RAM = better performance |
Storage | 2-3GB | For dependencies and models |
Platform | macOS (optimized), Linux, Windows | Apple Silicon fully supported |
# Install dependencies (requires Homebrew)
brew install npm pyenv
pyenv install 3.11
cd model_server
pyenv local 3.11
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Install Python 3.11 from https://www.python.org/downloads/
# (optional) pyenv-win can be used to manage multiple versions
cd model_server
py -3.11 -m venv .venv # or 'python -m venv .venv' if Python 3.11 is default
\.venv\Scripts\Activate.ps1 # For CMD use .venv\Scripts\activate
pip install -r requirements.txt
You can change the embedding model by modifying the owlspotlight.modelSettings.modelName
setting in VS Code. By default it uses Shuu12121/CodeSearch-ModernBERT-Owl-2.0-Plus
.
Japanese queries can be translated automatically by enabling owlspotlight.translationSettings.enableJapaneseTranslation
.
Progress bars during embedding can be disabled by setting the environment variable OWL_PROGRESS=0
.
Performance Tips:
- Use SSD storage for faster indexing
- Allocate more RAM for large projects
- Exclude unnecessary files via
.gitignore
- Consider
flash-attn
for CUDA environments
- Natural language search for Python functions/classes/methods
- Real-time incremental indexing
- Apple Silicon optimization
- Class relationship visualization
- Advanced filtering and statistics
- Experimental Java support
- Automatic language detection with selectable options
- Optional Japanese to English translation for search queries
- Multi-language support (JavaScript, TypeScript, Java, C++)
- VS Code Marketplace release
- Real-time file watching (auto-update on save)
- Class inheritance diagrams
We welcome contributions! Here's how you can help:
- 🐛 Report bugs in Issues
- 💡 Suggest features via GitHub Issues
- 🔧 Submit pull requests for improvements
- 📖 Improve documentation
MIT License - see LICENSE file for details.
OwlSpotlightは、VS CodeでPythonコードを自然言語で検索できる拡張機能です。 現在Visual Studio Code Marketplaceでも公開・配布しています。 従来のキーワード検索とは異なり、「メールを検証する関数」や「データベース接続を処理するクラス」など、意図を表現したクエリで関連するコードを素早く見つけることができます。
- 自然言語によるコード検索
- 高速な検索とインデックス更新
- 関数・クラス・メソッドの検索
- 関連度に基づくランキング
- 変更ファイルのみ再インデックス
- シンプルで使いやすいUI
- Apple Silicon対応
- CUDA/GPU 対応
- サイドバーから環境管理やキャッシュクリアが可能
前提条件: システムにPython 3.9+がインストールされていること
注意: クエリは英語または日本語で入力できます。設定で自動翻訳を有効にすると、日本語クエリは英語に変換されて検索されます。
- プロジェクトを開く - VS Codeでこのプロジェクトを開く
- 環境セットアップ - コマンドパレット(
Cmd+Shift+P
)で実行:OwlSpotlight: Setup Python Environment
- サーバー開始:
OwlSpotlight: Start Server
- サイドバーから検索を開始
- 拡張機能をビルド:
npm install npm run compile npx vsce package
- VS Codeで「Extensions: Install from VSIX...」を選択し、生成された
.vsix
ファイルをインストール - Python環境をセットアップ:
cd model_server python3.11 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt
従来の検索 | OwlSpotlight |
---|---|
def email_validation |
"function that validates email address" のような英語クエリや、日本語クエリを自動翻訳して検索可能 |
class Database |
英語・日本語どちらの自然なクエリでも検索可能(日本語は自動翻訳) |
キーワード完全一致が必要 | 完全一致でなくても意図が伝われば検索可能 |
関数名のみ対象 | コメントや処理内容も自然言語クエリで検索対象 |
OwlSpotlightは日本語クエリを英語に自動翻訳して検索することができます。翻訳サービスはGoogle Gemini APIのみ対応しています。
高精度な翻訳のためにGoogle Gemini APIを使用できます:
- Google AI Studioで無料のAPIキーを取得
- VS Codeの設定を開く(
Cmd+,
またはCtrl+,
) - 以下の設定を行う:
owlspotlight.translationSettings.enableJapaneseTranslation
:true
owlspotlight.translationSettings.geminiApiKey
: あなたのGemini APIキーowlspotlight.modelSettings.modelName
: Embedding model name (e.g.Shuu12121/CodeSearch-ModernBERT-Owl-2.0-Plus
)
使用例:
- 「メールアドレスを検証する関数」→ "function that validates email address"
- 「データベース接続を管理するクラス」→ "class that manages database connection"
- Python関数・クラス・メソッドの自然言語検索
- インクリメンタルインデックス更新
- Apple Silicon対応
- クラス構造の可視化
- フィルタ・統計表示
- Java対応(実験的)
- 多言語対応(JavaScript, TypeScript, Java, C++など)
- VS Code Marketplace公開
- ファイル保存時の自動更新
- クラス継承図の表示
GitHub Actions を利用した CI ワークフローを追加しました。main
ブランチへのプッシュや
プルリクエスト時に npm test
と eslint
を実行して拡張機能をビルドします。
タグ v*.*.*
を作成すると、自動的に VS Code 拡張機能 (vsix
ファイル) を生成し、
vsce publish
を使用してマーケットプレースへ公開できます。発行用のトークンは
VSCE_TOKEN
シークレットに設定してください。
MIT License - 詳細はLICENSEをご覧ください。
⚡ Made with ❤️ for developers who love efficient code navigation