This is the terminal version of The Surge. It is written for macOS and has full support for smart trainers with Bluetooth LowEnergy (all WAHOO, Elite smart trainers, TACX Neo and trainers supporting FTMS). You can ride workouts from MRC files and record those rides in the FIT format which can be processed by many platforms and other software.

Downloads

If you need some workouts files you can also download them here.

Here is a little screen cast from The Surge for Terminal in action

Developing Story

During development of The Surge we constructed many abstraction layers for the underlying communication with trainers and sensors. While also being big fans of the terminal for our daily development tasks we thought it would be a fun experiment to to try out running a workout exactly there.

The first problem was getting the correct permissions as we need to access bluetooth obviously. In macOS 12 Monterey this has been restricted and causes some trouble. Luckily there is core-bluetooth-tool from Dr. Mickey Lauer. We got a lot of inspiration from there. Thank you Mickey for your work!

The next feature to tackle was a nice user interface which is made possible by ANSI escape codes. In xcinfo we used a library named Rainbow which is basically good to use but lacks support for cursor control which caused some trouble there. So after some research it was decided to use ANSIEscapeCode.

After these steps it was just putting the pieces together and simplify the steps you would normally do in an UI-based application. The settings could be extracted into parameters, things like saving the resulting workout into the working directory were automated to reduce the number of arguments.

The last part was the really interesting challenge of the project which was also a good lesson in UX. Which steps do I really need? What are good default values? What can be automated? Building a command line tool from your app is a nice game we'll play more often in the future because it is super fast to play and brings a lot of astonishing results.

So this thing started as a joke but now it will be continued and maybe it's useful for someone. :)