lncli connect is used for connecting your LND node with other nodes.
What you really want to do in the given example is just calling a (getinfo-)command on a remote node. This won't work with the command "connect", instead just use:
lncli --rpcserver=<ip> <command>
lncli connect is used for connecting your LND node with other nodes. What you really want to do in the given example is just calling a (getinfo-)command on a remote node. This won't work with the command "connect", instead just use:
lncli --rpcserver=<ip> <command>