Improve db service registration in cmd.php