Open your console (F12) and type: var webconsoleapi = new WebConsoleAPI("ws://localhost:8080");
Replace ws:// with wss:// if your server have SSL enabled, localhost with your server IP and 8080 with your port.
Then call login(pwd) to login, sendConsoleCmd(cmd) to execute a command, etc...