#CommandPost

#API Documentation

ModuleDescription
hsCore Hammerspoon functionality
hs.alertSimple on-screen alerts
hs.appfinderEasily find hs.application and hs.window objects
hs.applescriptExecute AppleScript code
hs.applicationManipulate running applications
hs.application.watcherWatch for application launch/terminate events
hs.audiodeviceManipulate the system's audio devices
hs.audiodevice.datasourceInspect/manipulate the data sources of an audio device
hs.audiodevice.watcherWatch for system level audio hardware events
hs.axuielementThis module allows you to access the accessibility objects of running applications, their windows, menus, and other user interface elements that support the OS X accessibility API.
hs.axuielement.axtextmarkerThis submodule allows hs.axuielement to support using AXTextMarker and AXTextMarkerRange objects as parameters for parameterized Accessibility attributes with applications that support them.
hs.axuielement.observerThis submodule allows you to create observers for accessibility elements and be notified when they trigger notifications. Not all notifications are supported by all elements and not all elements support notifications, so some trial and error will be necessary, but for compliant applications, this can allow your code to be notified when an application's user interface changes in some way.
hs.base64Base64 encoding and decoding
hs.batteryBattery/power information
hs.battery.watcherWatch for battery/power state changes
hs.blackmagicSupport for the Blackmagic DaVinci Resolve Speed Editor Keyboard and Editor Keyboard.
hs.bonjourFind and publish network services advertised by multicast DNS (Bonjour) with Hammerspoon.
hs.bonjour.serviceRepresents the service records that are discovered or published by the hs.bonjour module.
hs.brightnessInspect/manipulate display brightness
hs.caffeinateControl system power states (sleeping, preventing sleep, screen locking, etc)
hs.caffeinate.watcherWatch for display and system sleep/wake/power events
hs.cameraInspect the system's camera devices
hs.canvasA different approach to drawing in Hammerspoon
hs.canvas.matrixA sub module to hs.canvas which provides support for basic matrix manipulations which can be used as the values for transformation attributes in the hs.canvas module.
hs.chooserGraphical, interactive tool for choosing/searching data
hs.consoleSome functions for manipulating the Hammerspoon console.
hs.crashVarious features/facilities for developers who are working on Hammerspoon itself, or writing extensions for it. It is extremely unlikely that you should need any part of this extension, in a normal user configuration.
hs.deezerControls for Deezer music player.
hs.dialogA collection of useful dialog boxes, alerts and panels for user interaction.
hs.dialog.colorA panel that allows users to select a color.
hs.distributednotificationsInteract with NSDistributedNotificationCenter
hs.docCreate documentation objects for interactive help within Hammerspoon
hs.doc.builderBuilds documentation support files. Still experimental.
hs.doc.hsdocsManage the internal documentation web server.
hs.doc.markdownMarkdown to HTML and plaintext conversion support used by hs.doc
hs.dockiconControl Hammerspoon's dock icon
hs.drawingDEPRECATED. Primitives for drawing on the screen in various ways.
hs.drawing.colorProvides access to the system color lists and a wider variety of ways to represent color within Hammerspoon.
hs.eventtapTap into input events (mouse, keyboard, trackpad) for observation and possibly overriding them
hs.eventtap.eventCreate, modify and inspect events for hs.eventtap
hs.exposeKeyboard-driven expose replacement/enhancement
hs.fnutilsFunctional programming utility functions
hs.fsAccess/inspect the filesystem
hs.fs.volumeInteract with OS X filesystem volumes
hs.fs.xattrGet and manipulate extended attributes for files and directories
hs.geometryUtility object to represent points, sizes and rects in a bidimensional plane
hs.gridMove/resize windows within a grid
hs.hashVarious hashing algorithms
hs.hidHID interface for Hammerspoon, controls and queries caps lock state
hs.hid.ledHID LED interface for Hammerspoon, controls the state of keyboard LEDs
hs.hintsSwitch focus with a transient per-application keyboard shortcut
hs.hostInspect information about the machine Hammerspoon is running on
hs.host.localeRetrieve information about the user's Language and Region settings.
hs.hotkeyCreate and manage global keyboard shortcuts
hs.hotkey.modalCreate/manage modal keyboard shortcut environments
hs.httpPerform HTTP requests
hs.httpserverSimple HTTP server
hs.httpserver.hsminwebMinimalist Web Server for Hammerspoon
hs.httpserver.hsminweb.cgiluaProvides support functions in the cgilua module for Hammerspoon Minimal Web Server Lua templates.
hs.httpserver.hsminweb.cgilua.lpSupport functions for the CGILua compatibility module for including and translating Lua template pages into Lua code for execution within the Hammerspoon environment to provide dynamic content for http requests.
hs.httpserver.hsminweb.cgilua.urlcodeSupport functions for the CGILua compatibility module for encoding and decoding URL components in accordance with RFC 3986.
hs.imageA module for capturing and manipulating image objects from other modules for use with hs.drawing.
hs.inspectProduce human-readable representations of Lua variables (particularly tables)
hs.ipcProvides Hammerspoon with the ability to create both local and remote message ports for inter-process communication.
hs.itunesControls for iTunes music player
hs.javascriptExecute JavaScript code
hs.jsonJSON encoding and decoding
hs.keycodesConvert between key-strings and key-codes. Also provides functionality for querying and changing keyboard layouts.
hs.layoutWindow layout manager
hs.locationDetermine the machine's location and useful information about that location
hs.location.geocoderConverts between GPS coordinates and more user friendly representations like an address or points of interest.
hs.loggerSimple logger for debugging purposes
hs.mathVarious helpful mathematical functions
hs.menubarCreate and manage menubar icons
hs.messagesSend messages via iMessage and SMS Relay (note, SMS Relay requires OS X 10.10 and an established SMS Relay pairing between your Mac and an iPhone running iOS8)
hs.midiMIDI Extension for Hammerspoon.
hs.milightSimple controls for the MiLight LED WiFi bridge (also known as LimitlessLED and EasyBulb)
hs.mjomatictmuxomatic-like window management
hs.mouseInspect/manipulate the position of the mouse pointer
hs.networkThis module provides functions for inquiring about and monitoring changes to the network.
hs.network.configurationThis sub-module provides access to the current location set configuration settings in the system's dynamic store.
hs.network.hostThis sub-module provides functions for acquiring host information, such as hostnames, addresses, and reachability.
hs.network.pingThis module provides a basic ping function which can test host availability. Ping is a network diagnostic tool commonly found in most operating systems which can be used to test if a route to a specified host exists and if that host is responding to network traffic.
hs.network.ping.echoRequestProvides lower-level access to the ICMP Echo Request infrastructure used by the hs.network.ping module. In general, you should not need to use this module directly unless you have specific requirements not met by the hs.network.ping module and the hs.network.ping object methods.
hs.network.reachabilityThis sub-module can be used to determine the reachability of a target host. A remote host is considered reachable when a data packet, sent by an application into the network stack, can leave the local device. Reachability does not guarantee that the data packet will actually be received by the host.
hs.noisesContains two low latency audio recognizers for different mouth noises, which can be used to trigger actions like scrolling or clicking.
hs.notifyThis module allows you to create on screen notifications in the User Notification Center located at the right of the users screen.
hs.osascriptExecute Open Scripting Architecture (OSA) code - AppleScript and JavaScript
hs.oscOpen Sound Control (OSC) support.
hs.pasteboardInspect/manipulate pasteboards (more commonly called clipboards). Both the system default pasteboard and custom named pasteboards can be interacted with.
hs.pasteboard.watcherWatch for Pasteboard Changes.
hs.pathwatcherWatch paths recursively for changes
hs.plistRead and write Property List files
hs.razerRazer device support.
hs.redshiftInverts and/or lowers the color temperature of the screen(s) on a schedule, for a more pleasant experience at night
hs.screenManipulate screens (i.e. monitors)
hs.screen.watcherWatch for screen layout changes
hs.serialCommunicate with external devices through a serial port (most commonly RS-232).
hs.settingsSerialize simple Lua variables across Hammerspoon launches
hs.sharingShare items with the macOS Sharing Services under the control of Hammerspoon.
hs.shortcutsList and run shortcuts from the Shortcuts app
hs.socketTalk to custom protocols using asynchronous TCP sockets.
hs.socket.udpTalk to custom protocols using asynchronous UDP sockets.
hs.soundLoad/play/manipulate sound files
hs.spacesThis module provides some basic functions for controlling macOS Spaces.
hs.spaces.watcherWatches for the current Space being changed
hs.speechThis module provides access to the Speech Synthesizer component of OS X.
hs.speech.listenerThis module provides access to the Speech Recognizer component of OS X.
hs.spoonsUtility and management functions for Spoons
hs.spotifyControls for Spotify music player
hs.spotlightThis module allows Hammerspoon to preform Spotlight metadata queries.
hs.spotlight.groupThis sub-module is used to access results to a spotlightObject query which have been grouped by one or more attribute values.
hs.spotlight.itemThis sub-module is used to access the individual results of a spotlightObject or a spotlightGroupObject.
hs.sqlite3Interact with SQLite databases
hs.streamdeckConfigure/control an Elgato Stream Deck.
hs.styledtextThis module adds support for controlling the style of the text in Hammerspoon.
hs.tabsPlace the windows of an application into tabs drawn on its titlebar
hs.tangentTangent Control Surface Extension
hs.taskExecute processes in the background and capture their output
hs.timerExecute functions with various timing rules
hs.timer.delayedSpecialized timer objects to coalesce processing of unpredictable asynchronous events into a single callback
hs.uielementA generalized framework for working with OSX UI elements
hs.uielement.watcherWatch for events on certain UI elements (including windows and applications)
hs.urleventAllows CommandPost to respond to URLs
hs.usbInspect USB devices
hs.usb.watcherWatch for USB device connection/disconnection events
hs.utf8Functions providing basic support for UTF-8 encodings
hs.voxControls for VOX music player
hs.watchableA minimalistic Key-Value-Observer framework for Lua.
hs.websocketSimple websocket client.
hs.webviewDisplay web content in a window from Hammerspoon
hs.webview.datastoreProvides methods to list and purge the various types of data used by websites visited with hs.webview.
hs.webview.toolbarCreate and manipulate toolbars which can be attached to the Hammerspoon console or hs.webview objects.
hs.webview.usercontentThis module provides support for injecting custom JavaScript user content into your webviews and for JavaScript to post messages back to Hammerspoon.
hs.wifiInspect WiFi networks
hs.wifi.watcherWatch for changes to the associated wifi network
hs.windowInspect/manipulate windows
hs.window.filterFilter windows by application, title, location on screen and more, and easily subscribe to events on these windows
hs.window.highlightHighlight the focused window
hs.window.layoutWARNING: EXPERIMENTAL MODULE. DO NOT USE IN PRODUCTION.
hs.window.switcherWindow-based cmd-tab replacement
hs.window.tilingWARNING: EXPERIMENTAL MODULE. DO NOT USE IN PRODUCTION.