The big benefit of using mbed is there really nice API which abstracts the hardware. The code for the API is Apache, and available on github[1].
Furthermore, you don't even need to use their online IDE to do anything. The online IDE has an option to export your project such that it can be built with arm-none-abi-gcc and make[2], or you can use their mbed-cli tool, which is a python based command line tool, and is also on github[3].
The mbed guys have way embraced open source and working with existing tools, and I wished the community would embrace them more, since I think their API's beat the snot out of Arduino.
[1]: https://github.com/ARMmbed/mbed-os [2]: https://developer.mbed.org/handbook/Exporting-to-offline-too... [3]: https://github.com/ARMmbed/mbed-cli