Snap works great for a lot of CLI software. All of the FOSS Snaps also publish their source code of how they are packaged. github.com/nextcloud-snap/nextcloud-snap , and the snap client app is FOSS too.
I don’t care that the server is controlled by Canonical. Most Flatpaks are on Flathub and it’s not a problem.