tools: add pipe_socket_to_command