added better cli detection