Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotlight Code

Index local source folders into index.json. Search by filename or snippet, then open the hit.

Menu extra for macOS 14+. Lives on the right of the menu bar. No Dock icon.


Build Latest Release macOS


Product SpotlightCode
Bundle ID engineer.badry.spotlightcode
Cask spotlight-code
Status item SF Symbol magnifyingglass
Panel opaque ~360×420 pt

What you get

Piece Behavior
Roots Folders in roots.json. Add folder / Remove.
Index Index now writes index.json. Cap 5000 files: Index capped at 5000 files.
Skip node_modules, .git, .build, DerivedData, dist, .next, Pods.
Exclude UserDefaults engineer.badry.spotlightcode.excludeGlobs. Defaults *.generated.swift, *.min.js.
Search Field prompt filename or symbol. Hits cap 80. Empty: No results / Clear search.
Spotlight After indexing, filenames are donated to Core Spotlight. Caption: After indexing, filenames also appear in Spotlight.
Intent App Intent SearchCodeIntent (Search Code).
Empty No folders / Add folder. Roots but never indexed: Not indexed yet / Index now.
Login Open at Login from Settings (SMAppService).

Download

File Use
SpotlightCode.app.zip Homebrew cask / unzip, drag SpotlightCode onto Applications

Releases


Install

Homebrew

brew tap BadryansahBangsawan/mac-menu-apps
brew trust BadryansahBangsawan/mac-menu-apps
brew install --cask spotlight-code

brew trust is required on Homebrew 6 or brew install --cask refuses the tap.

First open (ad-hoc signed):

xattr -cr /Applications/SpotlightCode.app
open /Applications/SpotlightCode.app

Still blocked: System Settings → Privacy & Security → Open Anyway.

Do not run dist/SpotlightCode.app while /Applications/SpotlightCode.app is running (same bundle ID).


How to open

This is an LSUIElement extra. Proof it is running is the magnifyingglass status item on the right of the menu bar, not a window from Finder or Launchpad.

  1. Click that extra. The panel is opaque ~360×420 pt, not a 10px strip.
  2. If the bar is full, look behind the Control Center overflow chevron «.
  3. Double-clicking in Finder/Launchpad only changes the left-side app name. That is expected. There is no Dock icon.

Usage

  1. Empty roots: No folders → Add folder.
  2. Roots but never indexed: Not indexed yet → Index now. While running: Indexing….
  3. Search is a labeled field (prompt filename or symbol). Query with no hits: No results → Clear search.
  4. Click a hit to open that file (up to 80 rows). Status line: file count and last index time, or never indexed.
  5. Settings at the bottom: Index folders, Exclude globs, Open at Login, Quit.

If Core Spotlight donation fails, the panel shows that error and still keeps index.json.


Permissions

No TCC prompts. Folder access is the standard open panel. Core Spotlight donation stays on this Mac.


Data

What Where
Roots ~/Library/Application Support/Spotlight Code/roots.json
Index ~/Library/Application Support/Spotlight Code/index.json
Exclude globs UserDefaults engineer.badry.spotlightcode.excludeGlobs
Open at Login SMAppService.mainApp (Settings toggle)

Decode failure → empty dump plus a red banner. The extra does not crash.


Privacy

No network. Source text is indexed only on this Mac (index.json plus optional Core Spotlight).


Uninstall

brew uninstall --cask spotlight-code

Or delete /Applications/SpotlightCode.app. Then:

rm -rf "$HOME/Library/Application Support/Spotlight Code"

Turn off Spotlight Code in System Settings → General → Login Items if it remains.


Troubleshooting

What you see What to do
Finder “opens” nothing / no Dock icon Click the magnifyingglass extra on the right of the menu bar.
Extra missing Overflow «, or pgrep -x SpotlightCode then open /Applications/SpotlightCode.app.
“Damaged” / cannot verify xattr -cr /Applications/SpotlightCode.app. spctl --assess is rejected even when it runs.
brew install --cask refuses the tap brew trust BadryansahBangsawan/mac-menu-apps
No folders Add folder in the panel or Settings.
Index now disabled Add a folder first.
Index capped at 5000 files Cap hit. Success, not a crash. node_modules / .git / .build / DerivedData / dist / .next / Pods are skipped as directory names.
Hits stale after an external disk mounts Re-add the folder, or quit and reopen after the volume is mounted.
No results Query does not match path or snippet. Clear search.
~10px empty strip under the bar Reinstall from this repo.

Build from source

git clone https://github.com/BadryansahBangsawan/spotlight-code.git
cd spotlight-code
swift build -c release --product SpotlightCode
bash package-app.sh
open dist/SpotlightCode.app

Tag v* runs CI: SpotlightCode.app.zip. Never commit dist/.

Layout: Sources/ (SwiftPM executable), Info.plist, Assets/AppIcon.icns, package-app.sh. FunTheme.swift is copied verbatim (no shared package).


FAQ

Why is there no Dock icon?
It is a menu extra. Click the magnifyingglass item on the right of the menu bar.

Does search leave this Mac?
No. Hits come from index.json. Core Spotlight donation is local.

Where is the index?
~/Library/Application Support/Spotlight Code/index.json.

How do I stop it opening at login?
Settings in the panel, or System Settings → General → Login Items → Spotlight Code.


MIT

About

Spotlight-style search over local source files

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages