Skip to main content

Installation

Spank can be installed by downloading a pre-built binary or building from source.

System requirements

Before installing, verify your system meets these requirements:
  • Operating system: macOS on Apple Silicon
  • Chip: M2 or newer (M2, M3, M4, etc.)
  • Permissions: sudo access for IOKit HID
  • Architecture: arm64
Spank requires root privileges to access the accelerometer via IOKit HID. You’ll need to run it with sudo spank.

Method 1: Download binary release

The fastest way to get started is to download a pre-built binary from GitHub releases.
1

Download the latest release

Visit the latest release page and download the binary for macOS ARM64.
2

Make it executable

chmod +x spank
3

Move to your PATH

sudo mv spank /usr/local/bin/
This makes spank available system-wide.
4

Verify installation

spank --version
You should see the version number printed.

Method 2: Build from source

Build Spank from source if you want the latest development version or need to modify the code.
Building from source requires Go 1.26 or later.
1

Install using go install

go install github.com/taigrr/spank@latest
This downloads the source, compiles it, and installs the binary to $GOPATH/bin (typically ~/go/bin).
2

Verify installation

~/go/bin/spank --version
3

Optional: Add to PATH

If ~/go/bin isn’t in your PATH, add it to your shell profile:
export PATH="$HOME/go/bin:$PATH"
Then reload your shell or run source ~/.zshrc (or ~/.bash_profile).

Alternative: Clone and build manually

For development or customization:
# Clone the repository
git clone https://github.com/taigrr/spank.git
cd spank

# Build the binary
go build -o spank .

# Run it
sudo ./spank

Verify installation

Test that Spank is correctly installed and has the necessary permissions:
sudo spank
You should see:
spank: listening for slaps in pain mode... (ctrl+c to quit)
Now slap your laptop gently. If you see output like:
slap #1 [medium amp=0.45231g] -> audio/pain/ow-03.mp3
You’re all set!

Troubleshooting

Spank requires root privileges for accelerometer access. Make sure you’re running with sudo:
sudo spank
From main.go:208-210, the check is:
if os.Geteuid() != 0 {
    return fmt.Errorf("spank requires root privileges for accelerometer access, run with: sudo spank")
}
Spank requires Apple Silicon M2 or newer. M1 chips use a different accelerometer sensor and are not currently supported.Verify your chip:
sysctl -n machdep.cpu.brand_string
If building from source, you need Go installed. Download it from go.dev/dl or install via Homebrew:
brew install go
Ensure you downloaded the ARM64 binary, not x86_64. Check with:
file /usr/local/bin/spank
Should output: Mach-O 64-bit executable arm64

Next steps

Quickstart

Learn how to use Spank’s different modes and customize sensitivity

Build docs developers (and LLMs) love