OpenConnect is a VPN client that can replace Cisco Anyconnect on multiple platforms, it is useful as it allows to run multiple concurrent VPN whereas Cisco Anyconnect cannot.
In order to make its day-to-day usage more straightforward you may want to configure a shell alias to run the full command and input your password, this will also allow you to ask for the second password that can be used with multifactor authentication systems, such as Duo Mobile.
Below are the steps to get it working on macOS with Z shell.
1- Install OpenConnect via Homebrew
2- Add it to the sudoers with NOPASSWD privileges
Add the following line:
3- Customize the following alias to your needs and add it to ~/.zshrc – if you are using bash the read command will need some adjustments
4- You should be able to connect using the alias my-vpn!
Source: OpenConnect on Mac OS X