Skip to content

About

macOS desktop automation for programmers. Making the runtime, funtime.

Resources

Code of conduct

Contributing

Stars

247 stars

Watchers

4 watching

Forks

Latest commit

 

History

1,440 Commits

Folders and files

Repository files navigation

Hammerspoon 2

What is Hammerspoon?

This is a tool for powerful automation of macOS. At its core, Hammerspoon is just a bridge between the operating system and a JavaScript scripting engine.

What gives Hammerspoon its power is a set of modules that expose specific pieces of system functionality, to the user. With these, you can write JavaScript to control many aspects of your macOS environment.

The first version of Hammerspoon used Lua for its scripting engine, this is a modernized rewrite that uses the same JavaScript engine as Safari.

Minimum requirements

Hammerspoon 2 requires macOS 27 or later.

How do I install it?

Manually

  • Download the latest release
  • Drag Hammerspoon 2.app from your Downloads folder to /Applications

Homebrew

brew install --cask hammerspoon/tap/hammerspoon2

This also puts the hs2 command line tool on your PATH. Hammerspoon 2 updates itself, so brew upgrade leaves it alone unless you pass --greedy.

Getting Started

  • If you are new to Hammerspoon, read our Getting Started Guide
  • If you are coming from the original Hammerspoon, see our Migration Guide
  • Full API documentation can be found here, or by running hs.docs.show() in the Hammerspoon Console window.

Getting Help

Development

Building

This is an Xcode project. Open Hammerspoon 2.xcodeproj in Xcode to build. To generate doc artifacts, run npm install in the top level of the repository.

The code is linted with SwiftLint (rules in .swiftlint.yml), which runs as a Swift package build tool plugin. The first time you build, Xcode asks you to trust and enable SwiftLintBuildToolPlugin. Command line builds need the same approval, or -skipPackagePluginValidation passed to xcodebuild.

License

See the LICENSE file for details.

Acknowledgments

This is a modernized rewrite of the original Hammerspoon project, and builds on projects such as:

About

macOS desktop automation for programmers. Making the runtime, funtime.

Resources

Code of conduct

Contributing

Stars

247 stars

Watchers

4 watching

Forks

Releases

Used by

Contributors

Languages