pub async fn main_loop( cli: Cli, config: Arc<RwLock<ClientConfig>>, command_tx: Sender<Message>, command_rx: Receiver<Message>, ) -> Result<()>