bugfix: CLI mode detection was not working

isCLIMode: new library function