AG Global Search
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

Features
- ⚡ 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
Prerequisites
You need to have AG (The Silver Searcher) installed on your system:
Linux
# Ubuntu/Debian
sudo apt-get install silversearcher-ag
# Fedora
sudo dnf install the_silver_searcher
# Arch Linux
sudo pacman -S the_silver_searcher
macOS
brew install the_silver_searcher
Windows
Download from AG releases or use:
choco install ag
Verify installation:
ag --version
Installation
For Development
- 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
F5 to open a new window with the extension loaded
For Use in VS Code/Cursor
- Package the extension:
npm install -g vsce
vsce package
- Install the
.vsix file:
- In VS Code/Cursor:
Extensions → ... → Install from VSIX...
- Or use command line:
code --install-extension ag-search-0.1.0.vsix
Usage
Search in Project
- Press
Ctrl+Shift+F (or Cmd+Shift+F on 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
Search in Folder
- 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
Viewing Results
- 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
Configuration
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"])
Example Settings
{
"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"
]
}
Development
Building
npm install
npm run compile
Watching for Changes
npm run watch
Testing
- Open the project in VS Code or Cursor
- Press
F5 to launch a new Extension Development Host window
- Test the extension in the new window
Keyboard Shortcuts
Ctrl+Shift+F (Windows/Linux) or Cmd+Shift+F (macOS): Search in project
Troubleshooting
AG not found
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
No results found
- 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
Extension not working
- Check the Output panel for "AG Search" channel
- Verify AG is installed and accessible
- Check Cursor's Developer Tools console for errors
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Repository
Author
afshmini