share cmd-handler between repl and webrepl