Following on from a StackOverflow question that tuned out to be about sdcli, there does seem to be a small bug in sqlcli in 4.0 EA1 and EA2. The sqlcli.bat and sqlcli files both refer to the wrong version of a file:
Running the OS X version as sh ./sqlcli (since it isn't executable by default) gives:
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/ide/Version
In both cases it should now point to oracle.javatools_12.1.2, apparently. This isn't OS X-specific, the same files are in the Windows version, not surprisingly.
java.lang.StringIndexOutOfBoundsException that the original question was about is also unhelpful, but I don't know if it's always done that if you don't give the first argument as username/password@tns.