Hammerspoon logo

Hammerspoon

Staggeringly powerful macOS desktop automation with JavaScript. Making the runtime, funtime.

free macOS Automation & Workflow

Hammerspoon is a automation & workflow tool built by Hammerspoon. It's best for macOS users seeking advanced desktop automation and Developers and power users who want to script macOS functionalities. Pricing is free.

Pricing

free

Audience

macOS users seeking advanced desktop automation

Platforms

Community

0%

About Hammerspoon

Hammerspoon is a tool for macOS that enables powerful desktop automation by bridging the operating system with a JavaScript scripting engine.

Hammerspoon provides a framework for users to write JavaScript code that interacts directly with macOS APIs. This allows for extensive customization and automation of various system functionalities, including applications, windows, hotkeys, keyboard and mouse actions, screens, Spaces, the filesystem, audio devices, Bluetooth, Wi-Fi, and notifications. It also supports interaction with AppleScript and Shortcuts.

The platform offers a set of modules that expose specific pieces of system functionality, allowing users to build custom automation scripts. For instance, users can create their own windows and menus using `hs.ui` or draw directly onto the screen with `hs.canvas`. The tool is designed for creating a configuration file, typically `init.js`, where users define event-action bindings.

Common use cases for Hammerspoon include binding keyboard shortcuts to window operations or AppleScripts, running a series of commands when a Mac connects to a specific Wi-Fi network, displaying alerts for low battery percentages, or even automating music playback based on location detection. The project is open-source and developed on GitHub, with a community available on Discord for support and discussions.

Key Features

macOS desktop automation
JavaScript scripting engine
Interaction with macOS APIs (applications, windows, hotkeys, keyboard, mouse, screens, Spaces)
Filesystem control
Audio device management
Bluetooth and Wi-Fi control
Notifications management
AppleScript and Shortcuts integration
Custom UI creation (windows, menus) with hs.ui
Direct screen drawing with hs.canvas
Configuration via JavaScript files (init.js)
Built-in API documentation
Spoons (ready-made plugins) support
Self-updating application

Pricing

free

Hammerspoon is an open-source project and is available for free. There are no paid tiers or subscription models mentioned.

Who is it for?

Best for

  • Automating repetitive tasks on macOS
  • Creating custom keyboard shortcuts and window management rules
  • Scripting system events based on network changes or battery levels
  • Developers who prefer JavaScript for system automation

Not ideal for

  • Users unfamiliar with JavaScript or scripting
  • Cross-platform automation beyond macOS
  • Simple, out-of-the-box automation without custom coding

Integrations

AppleScript Shortcuts

Community Discussion

Sign in to contribute

No discussions yet. Be the first to share your experience!

Frequently asked questions