You have to create an Adobe Native Extension with one method and one event
execute(param:String) //Calls a unix shell command, for example it can be "su pm list"
and then it return a string or dispatch an event with the result of the shell command.
That's it
Please dont offer if you dont know what an ANE is