ContextPilot VSCode Plugin
May 20, 2025 ยท View on GitHub
Users need to first install the server locally. The binary is currently available on homebrew:
brew install krshrimali/context-pilot/context-pilot
OR if using AUR, refer: https://aur.archlinux.org/packages/contextpilot.
In case you are not using either of the package managers above, follow the commands below: (cargo installation is must)
git clone https://github.com/krshrimali/context-pilot-rs && cd context-pilot-rs
cargo build --release
cp ./target/release/contextpilot ~/.local/bin/
Feel free to replace the binary path to /usr/local/bin based on your system.
Usage
- Open your workspace.
- Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
- (Optional, for faster querying) - Index your workspace (
Context Pilot: Index Workspace) - please note that, this might be slower for huge workspaces. - (Optional, for faster querying) - Only index selected subdirectories (
Context Pilot: Index Subdirectories) - select the subfolders you want to index, faster for huge workspaces (like monorepos). - Run
Context Pilot: Current Fileto get related files for the current file. Can be slower for huge files (>10k-20k LoCs). - Run
Context Pilot: Get Relevant Commitson a selected piece of code to fetch relevant commits. - Run
Context Pilot: Get Context Files for Selected Rangeon a selected piece of code to fetch relevant files.
ContextPilot ๐ง
ContextPilot is a powerful VSCode extension to understand the context of your codebase quickly!
It lets you find related files, top authors, and historical context directly from Git history and file relationships โ without leaving your editor.
โจ Features
- ๐ Query Top Files related to a line or file.
- ๐ See Usage Frequency (Occurrences) inside your project.
- ๐ Open related files instantly in VSCode.
- โก Super fast, powered by Rust backend for indexing & querying.
- ๐ ๏ธ Supports indexing with progress shown (Coming soon).
- ๐ฅ๏ธ Designed for large workspaces and monorepos.
๐ Getting Started
1. Install
- Download and install from the VSCode Marketplace.
2. Commands
| Step | Action | Description | Notes |
|---|---|---|---|
| 3 | Index Workspace | Index the entire workspace for faster querying. | Slower for large workspaces. |
| 4 | Index Subdirectories | Index only selected subdirectories for faster querying. | Recommended for large workspaces or monorepos. |
| 5 | Run Context Pilot: Current File | Get related files for the currently opened file. | May be slower for large files (>10kโ20k LoCs). |
| 6 | Run Context Pilot: Get Relevant Commits | Fetch relevant commits for a selected piece of code. | Useful for tracing history of specific code sections. |
| 7 | Run Context Pilot: Get Context Files for Selected Range | Fetch relevant files based on the selected code range. | Helps understand code dependencies. |
โก These commands can be triggered via the Command Palette (
Ctrl+Shift+P) by typingContext Pilot.
3. Requirements
- Rust and Cargo installed (for running the backend binary
contextpilot). - Git installed and available in PATH.
contextpilotavailable as a binary in your PATH. Go to https://github.com/krshrimali/context-pilot-rs for information. (This step will be removed soon)
๐ ๏ธ Development Setup
Clone the repo:
git clone https://github.com/krshrimali/context-pilot-vscode.git
cd context-pilot-vscode
npm install && npm run compile
vsce package
Once done, you can install this extension from .vsix file generated (ctrl/cmd + shift + P -> install extension from VSIX file).
๐ค Contributing
Pull Requests are welcome!
Feel free to open an issue or suggest features.
๐ฌ Contact
- GitHub: @krshrimali
โค๏ธ Support
If you like this project, please consider starring ๐ the repository! It helps a lot!