Properly detect CLI in cron jobs