According to the documentation off Visual Studio CODE, you can open the editor from terminal by adding the following lines to your .bash_profile on OS X.
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
That just works.
Now the question is, what needs to be done to allow the command to work if you try to launch it with administrator privileges.?
ie:
sudo code .