Ipfs cli interface connecting to a remote node

I would like to use standard cli interface, but which is configured to upload the files to a remote node. Do you think it is possible in principle?
I assume that when you run ipfs command, it connects to some default port (4001?) of the localhost on which the daemon is supposed to listen to commands. Can you please confirm that? The idea is to stop the daemon itself and then configure ssh tunnelling of the port 4001 to the remote node’s 4001 port. Do you think it is a right approach? Any better ideas?

Thank you!

See ipfs --help where it shows there is an --api flag to point to a potentially remote api endpoint.