hammerspoon2-docs
    Preparing search index...

    Namespace ipc

    Module for enabling CLI access to Hammerspoon 2 via the hs command-line tool. The IPC server must be explicitly started from your configuration — it does not run by default. Once started, the hs 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 hs to /usr/local/bin/hs
    
    hs
    hs> hs.reload()
    undefined
    hs> 2 + 2
    4
    hs --log-level info
    

    Variables

    isListening

    Functions

    installBinary
    isBinaryInstalled
    start
    stop
    uninstallBinary