How to open .brs file in mac

Hi i am new to Roku SDK, i am not sure how to open .brs files on mac and how to run text editor in terminal to debug the code?

Can any one let me know please?