As the underlying layers /Os is not talking WISpr/not running a program to deal with captive portals, for connecting to a captive portal in the command line, you only need a browser or a script.
One of the possible solutions is using lynx, a text mode browser.
It will work in most captive portals, and will allow you to enter your login and password to authenticate in the captive portal. I am not sure it is WISpr aware (i.e. a few rare portals where WISpr is mandatory)
In the past there were also bash scripts floating around for FON, they are not working nowadays. as in https://gist.github.com/cusspvz/3ab1ea9110f4ef87f0d2e1cd134aca67 or this one https://gist.github.com/itay-grudev/d3d4eb0dc4e239d96c84
A good clue how to write such a script can be seen here in python. However, you will have to adapt it to your specific needs.
https://github.com/Palakis/fortilogin
However for the majority of portals out there, lynx is fine.
See the related question Captive portal using Apache
For having an idea what is the WISpr tags I am talking about, see Getting WISPr tags from a FON authentication portal
For others reading this question, to be able to test a browser like Chrome , Firefox or lynx in a Mac authenticating in a portal, you need to disable CNA. See related Disabling CNA in MacOS
P.S. With the notable exception of major telecoms, and some wireless vendors like Ruckus (and a couple of ready-made captive portals like PfSense and CoovaChili), many (re)implementations of captive portals only implement the captive/redirection part and do not implement WISpr.
Being captive portals automagically dealt with by Apple, Windows, Android and iOS only adds to the confusion of many people not knowing how to deal with captive portals when in less complex systems because they have that nice layer of abstraction in more complex systems.
To deal with captive portals in systems not detecting them, you need to open a browser and hit reload/try to open a web page, to get presented with a page for accepting the provider clauses/ToS, and/or to get authenticated.
curl
to submit the authentication information. – telcoM Aug 26 '18 at 12:37dhclient
and theiw
tools, but I couldn't get past those terms (also I don't know what the URL for them is), but I know it's possible because my Tablet had no trouble connecting. – leeand00 Aug 26 '18 at 15:36