A Go library that talks to a GoCube, the Rubik’s cube with Bluetooth inside. It reads every twist in real time, tracks the cube’s state, and works out which stage of the solve you are in.
The GoCube is a normal-feeling speedcube with sensors and a Bluetooth radio in it. Turn a face and it tells you, with a timestamp. I wanted to do something with that data from Go, so I wrote a library for it.
What it gives you
The API is callback-based and deliberately plain. Connect to the first cube it finds, then register handlers: OnMove for every turn, OnPhaseChange when you finish a stage, OnSolved when it comes good. It tracks the virtual state of the cube as the moves arrive, so at any point you can ask whether it is solved and which phase you are in.
Phase detection is the part I am happiest with. It watches the state and works out, on its own, when you have finished the cross, the first two layers, the orientation of the last layer and its permutation, the standard CFOP stages. That makes it useful for a solve timer or a training tool that knows where your time actually went.

Without a cube
You do not need the hardware to use the model. There is a standalone simulation: make a solved cube in memory, apply moves with constants like gocube.R and gocube.UPrime, or parse standard notation like F B2 L' D, then read the state back. Handy for tests, and for the 3D visualiser that plays a solve back and analyses it.
There is a CLI as well, installable on its own, and the whole thing is documented on pkg.go.dev. One caveat worth stating plainly: the BLE side is macOS only for now. The cube model runs anywhere; talking to a physical cube does not. MIT licensed.
- Library:
go get github.com/SeamusWaldron/gocube_ble_library - GitHub: github.com/SeamusWaldron/gocube_ble_library