
Hammerspoon
Open SourcePowerful automation tool for macOS with Lua scripting
AI Summary
Hammerspoon is automation software for macOS that enables deep system integration through Lua scripting. Users can automate keyboard shortcuts, window management, network events, hardware status, and many other macOS functions. The tool is designed for technically proficient users who want to optimize their workflows through custom-written scripts.

✓ Pros
- +Extremely flexible and powerful macOS automation through direct API integration
- +Open source and free with active community
- +Extensible through Lua scripts and pre-built Spoons plugins
✗ Cons
- −Requires programming knowledge in Lua and familiarity with the API
- −Does not work out-of-the-box without custom configuration
Use Cases
- →Automatic window management and positioning via keyboard shortcuts
- →Execute actions based on Wi-Fi connections or location
- →Battery monitoring with custom notifications
- →Clipboard management and advanced keyboard/mouse event control
Who is it for?
Power users, developers, and macOS enthusiasts who want to maximize their workflows through scripting-based automation.
Tags
What is Hammerspoon?
Hammerspoon connects macOS system functions with a Lua scripting engine. The open-source tool provides an extensive API that gives users direct access to windows, keyboard events, network status, hardware sensors and other operating system layers. Configuration is done entirely through self-written Lua scripts. Without a script, the tool is empty. With one, macOS can be controlled in large parts according to your own preferences.
Core features
- Window management via keyboard shortcut: Windows can be moved to defined positions and sizes via script, without installing a separate app.
- Network and location events: Hammerspoon responds to Wi-Fi connections and can automatically trigger actions as a result, such as starting a VPN or adjusting volume.
- Battery monitoring: Custom thresholds and notifications can be configured in a few lines of Lua.
- Clipboard and input control: Keyboard and mouse inputs can be intercepted, redirected or assigned custom logic.
- Spoons ecosystem: The community maintains pre-built Lua modules called Spoons, which can be integrated directly and speed up getting started.
Who is Hammerspoon for?
Developers and power users who want to control their macOS environment programmatically. Knowledge of Lua is a requirement. Those unfamiliar with the language will need to learn it or work through other people's configurations. The API documentation also assumes technical reading comprehension. For users who want to set up window management or automations through a graphical interface, Hammerspoon is the wrong starting point.
Context & alternatives
Hammerspoon occupies a niche where flexibility takes priority over ease of use. Tools such as Keyboard Maestro (graphical, considerably more beginner-friendly, but paid) and BetterTouchTool (strong on input customisation, also with a GUI) take comparable approaches on macOS. Hammerspoon is the only tool mentioned here that is completely free and open source. Those willing to write Lua get an automation tool without artificial limits imposed by UI constraints.




