When running in the web app context, there are $_SERVER variables that Cake accesses to understand what domain you are on. When running from the CLI, these don’t exist. This is what the App.fullBaseUrl setting is for.
Note that App.fullBaseUrl can also be useful in web context, if you have multiple domains that your app runs under, but you want all emails that go out to reference a “primary” one regardless of which one the user is on when the email is triggered.