Install
openclaw skills install spotlightSearch files and content using macOS Spotlight indexing (mdfind). Use when the user asks to search local files, documents, or directories on macOS. Supports...
openclaw skills install spotlightSearch local files using macOS Spotlight indexing system.
Use this skill when:
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
🔍 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/
Spotlight automatically indexes:
# Check if a volume is indexed (safe, read-only)
mdutil -s /path/to/volume
⚠️ WARNING: Do NOT execute any sudo commands from this skill without explicit user confirmation. Commands like sudo mdutil -i on require admin privileges and should only be run by the user directly in Terminal.
spotlight-search.sh to find relevant filesUser: "Find all documents about machine learning in my research folder"
spotlight-search.sh ~/research "machine learning" --limit 10Spotlight supports advanced query operators:
# Exact phrase
spotlight-search.sh ~/Documents "\"machine learning\""
# AND operator
spotlight-search.sh ~/Documents "neural AND networks"
# OR operator
spotlight-search.sh ~/Documents "AI OR artificial intelligence"
# Metadata queries (PDF only)
spotlight-search.sh ~/Documents "kMDItemContentType == 'com.adobe.pdf'"
No results found:
mdutil -s /pathIncorrect results:
"exact phrase"| Tool | Speed | Content Search | Multilingual |
|---|---|---|---|
| Spotlight | ⚡ Instant | ✅ Yes | ✅ Yes |
| grep/ripgrep | 🐢 Slow | ✅ Yes | ✅ Yes |
| find | ⚡ Fast | ❌ No | N/A |
grep -r or ripgrep