hammerspoon2-docs
    Preparing search index...

    Namespace ipc

    Module for enabling CLI access to Hammerspoon 2 via the hs2 command-line tool. The IPC server must be explicitly started from your configuration — it does not run by default. Once started, the hs2 command-line tool connects via XPC and evaluates JavaScript interactively, with optional live log streaming. Communication is secured with a same-team code-signing requirement in release builds, so only binaries signed with the same Team ID can connect.

    // In your Hammerspoon 2 config (init.js):
    hs.ipc.start()
    hs.ipc.installBinary()   // symlinks hs2 to /usr/local/bin/hs2
    
    hs2
    hs2> hs.reload()
    undefined
    hs2> 2 + 2
    4
    hs2 --log-level info
    

    Variables

    isListening

    Functions

    installBinary
    isBinaryInstalled
    start
    stop
    uninstallBinary