| name | spotlight |
| description | Search files and content using macOS Spotlight indexing (mdfind). Use when the user asks to search local files, documents, or directories on macOS. Supports text content search inside PDFs, Word documents, text files, and more. Much faster than grep for large document collections. Only works on macOS systems with Spotlight enabled. |
Spotlight Search
Search local files using macOS Spotlight indexing system.
When to Use
Use this skill when:
- User asks to search files or directories on macOS
- Need to find documents containing specific text
- Searching large document collections (faster than grep)
- Need to search inside PDFs, Word docs, or other indexed formats
Quick Start
scripts/spotlight-search.sh <directory> <query> [--limit N]
Examples:
scripts/spotlight-search.sh ~/Documents "machine learning"
scripts/spotlight-search.sh ~/research "neural networks" --limit 10
scripts/spotlight-search.sh ~/Downloads "meeting notes" --limit 5
Search Features
- Fast: Uses system-level Spotlight index (no file scanning)
- Content-aware: Searches inside PDF, docx, txt, md, etc.
- Multilingual: Supports Chinese, Japanese, and all languages
- Metadata: Returns file path, type, and size
Output Format
🔍 Searching in /path/to/directory for: query
✅ Found N results (showing up to M):
📄 /full/path/to/file.pdf [pdf, 2.3M]
📄 /full/path/to/document.txt [txt, 45K]
📁 /full/path/to/folder/