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

  1. Open your workspace.
  2. Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
  3. (Optional, for faster querying) - Index your workspace (Context Pilot: Index Workspace) - please note that, this might be slower for huge workspaces.
  4. (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).
  5. Run Context Pilot: Current File to get related files for the current file. Can be slower for huge files (>10k-20k LoCs).
  6. Run Context Pilot: Get Relevant Commits on a selected piece of code to fetch relevant commits.
  7. Run Context Pilot: Get Context Files for Selected Range on a selected piece of code to fetch relevant files.

ContextPilot ๐Ÿง 

License: MIT

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

StepActionDescriptionNotes
3Index WorkspaceIndex the entire workspace for faster querying.Slower for large workspaces.
4Index SubdirectoriesIndex only selected subdirectories for faster querying.Recommended for large workspaces or monorepos.
5Run Context Pilot: Current FileGet related files for the currently opened file.May be slower for large files (>10kโ€“20k LoCs).
6Run Context Pilot: Get Relevant CommitsFetch relevant commits for a selected piece of code.Useful for tracing history of specific code sections.
7Run Context Pilot: Get Context Files for Selected RangeFetch 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 typing Context Pilot.


3. Requirements

  • Rust and Cargo installed (for running the backend binary contextpilot).
  • Git installed and available in PATH.
  • contextpilot available 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


โค๏ธ Support

If you like this project, please consider starring ๐ŸŒŸ the repository! It helps a lot!