<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Biagio</title>
    <description>The latest articles on DEV Community by Biagio (@biagio_3d79f21c2c89f2c402).</description>
    <link>https://dev.to/biagio_3d79f21c2c89f2c402</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3887228%2Fce5d2350-a76b-4303-b8d7-a408c13f4092.png</url>
      <title>DEV Community: Biagio</title>
      <link>https://dev.to/biagio_3d79f21c2c89f2c402</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/biagio_3d79f21c2c89f2c402"/>
    <language>en</language>
    <item>
      <title>I built a "smart Spotlight" for macOS that sees your screen and executes tasks, here a couple of takeaways</title>
      <dc:creator>Biagio</dc:creator>
      <pubDate>Sun, 19 Apr 2026 10:41:16 +0000</pubDate>
      <link>https://dev.to/biagio_3d79f21c2c89f2c402/i-built-a-smart-spotlight-for-macos-that-sees-your-screen-and-executes-tasks-here-a-couple-of-1ce0</link>
      <guid>https://dev.to/biagio_3d79f21c2c89f2c402/i-built-a-smart-spotlight-for-macos-that-sees-your-screen-and-executes-tasks-here-a-couple-of-1ce0</guid>
      <description>&lt;p&gt;I was sick of constantly jumping between Spotlight, the terminal, and an AI chatbot just to run simple tasks. So I built Castor.&lt;/p&gt;

&lt;p&gt;It’s a Spotlight-style overlay for macOS, but instead of just finding files, it actually executes commands using context from whatever you currently have open. It's free and open-source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it looks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehc7nbzemh4ja5fk3ywj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehc7nbzemh4ja5fk3ywj.png" alt=" " width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Spotlight’s UI is great because it’s completely frictionless. I wanted that same UX for automation—hitting a hotkey and typing "rename all selected files to lowercase" or "summarize this Safari tab."&lt;/p&gt;

&lt;p&gt;To make it seamless, Castor grabs your context before sending the prompt. It silently pulls:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Active Finder paths and selected files&lt;/li&gt;
&lt;li&gt;Browser tabs and URLs (Safari and Chrome)&lt;/li&gt;
&lt;li&gt;Clipboard text&lt;/li&gt;
&lt;li&gt;A screenshot of the current screen (via ScreenCaptureKit)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You just ask for what you want without explaining what you're looking at.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The backend (and fighting Node.js)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’m using Gemini Flash via gemini-cli. It’s fast and easy to hook into from Swift. The catch is that gemini-cli is Node-based, and the cold start latency was ruining the Spotlight feel.&lt;/p&gt;

&lt;p&gt;To fix this, Castor keeps a background process warm. When you dismiss the UI, it spins up a fresh instance for the next run. Only the very first boot feels slow now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skipping the AI roundtrip&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I realized I was running the same few scripts repeatedly ("resize to 800px", "convert to PDF"). Castor now has a "Script Memory" feature that saves successful shell commands and fuzzy-matches them later. If there’s a strong match, you get an instant suggestion you can trigger with one key, bypassing the AI completely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Handling concurrency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first version blocked you from doing anything else while a task was running. Now, you can fire off multiple tasks in parallel. They show up in a vertical stack (like iMessage), each with its own output stream and cancel button. Getting this to play nicely with Swift 6.2’s strict actor isolation was a headache, but the code is much safer for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UI &amp;amp; Specs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The overlay is a non-activating NSPanel that floats without stealing focus, using the new native .glassEffect() to feel like a first-party tool. There’s also a menu bar Live Activity to track progress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s next&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Still plenty of rough edges since it's a personal project. I'm currently looking into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better context extraction (Terminal, VS Code, Xcode)&lt;/li&gt;
&lt;li&gt;Local model support&lt;/li&gt;
&lt;li&gt;Editable script memory&lt;/li&gt;
&lt;li&gt;Shortcuts integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code is on GitHub. PRs, issues, and feedback are welcome.&lt;br&gt;
GitHub: &lt;a href="https://github.com/biagio-incardona/Castor" rel="noopener noreferrer"&gt;https://github.com/biagio-incardona/Castor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built with Swift 6.2, SwiftUI, ScreenCaptureKit, AppKit, and gemini-cli. Requires macOS 26 Tahoe.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
