A VS Code and Cursor IDE extension that uses AG (The Silver Searcher) for fast, powerful global search across your project.
Works with: VS Code 1.75+ and Cursor IDE
- ⚡ Fast Search: Uses AG (The Silver Searcher) for lightning-fast code searching
- 🔍 Global Search: Search across your entire project, not just open files
- 📁 Folder Search: Option to search within a specific folder
- 📊 Results View: View search results in an organized tree view
- 🎯 Quick Navigation: Click results to jump directly to matches
- ⚙️ Configurable: Customize AG options and ignore patterns
You need to have AG (The Silver Searcher) installed on your system:
# Ubuntu/Debian
sudo apt-get install silversearcher-ag
# Fedora
sudo dnf install the_silver_searcher
# Arch Linux
sudo pacman -S the_silver_searcherbrew install the_silver_searcherDownload from AG releases or use:
choco install agVerify installation:
ag --version- Clone the repository:
git clone https://github.com/afshmini/ag-search.git cd ag-search - Open the project in VS Code or Cursor
- Install dependencies:
npm install
- Compile the extension:
npm run compile
- Press
F5to open a new window with the extension loaded
- Package the extension:
npm install -g vsce vsce package
- Install the
.vsixfile:- In VS Code/Cursor:
Extensions→...→Install from VSIX... - Or use command line:
code --install-extension ag-search-0.1.0.vsix
- In VS Code/Cursor:
- Press
Ctrl+Shift+F(orCmd+Shift+Fon macOS) to open the search dialog - Enter your search term
- Results will appear in the "AG Search Results" view in the Explorer sidebar
- Click on any result to navigate to that location
- Open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type "AG: Search in Folder"
- Enter your search term
- Select the folder to search in
- Results will appear in the "AG Search Results" view
- Results are grouped by file
- Each file shows the number of matches
- Expand files to see individual matches with line numbers and context
- Click any result to jump to that location in the editor
You can configure the extension in Cursor settings:
- cursor-ag.agPath: Path to the AG executable (default:
"ag") - cursor-ag.defaultOptions: Default AG options (default:
["--smart-case", "--numbers", "--column"]) - cursor-ag.ignorePatterns: Patterns to ignore in searches (default:
["node_modules", ".git", "dist", "build", ".next", ".cache"])
{
"cursor-ag.agPath": "/usr/local/bin/ag",
"cursor-ag.defaultOptions": [
"--smart-case",
"--numbers",
"--column",
"--hidden"
],
"cursor-ag.ignorePatterns": [
"node_modules",
".git",
"dist",
"build",
"*.min.js"
]
}npm install
npm run compilenpm run watch- Open the project in VS Code or Cursor
- Press
F5to launch a new Extension Development Host window - Test the extension in the new window
Ctrl+Shift+F(Windows/Linux) orCmd+Shift+F(macOS): Search in project
If you get an error that AG is not found:
- Verify AG is installed:
ag --version - Check if AG is in your PATH
- Set the full path in settings:
cursor-ag.agPath
- Check that your search term is correct
- Verify that files aren't being ignored by your ignore patterns
- Try searching with a simpler term first
- Check the Output panel for "AG Search" channel
- Verify AG is installed and accessible
- Check Cursor's Developer Tools console for errors
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
afshmini
- Email: afshmini@gmail.com
- GitHub: @afshmini