Bit library for mycropython

Hello, I am looking forward to use my own IDE when writting MycroPython scripts for BIT. However, I need to include the library for Bit and I can’t find it anywhere, it only works when writting the code on the website as it seems to be included in the “background” somehow. How I can get it and import it on my IDE when coding? Also, how can I get the Bit to run the same Mycropython code after restart, without reuploading every time? Making it persistent is a nice thing if I want to give the Bit to my daughter to play and for some reason the battery runs out and needs to restart.