print to stderr if called from a terminal
replace jsonrpc based interface with command files again