Make backup of contacts with bash script

Is it possible to backup (e. g. .csv or .vcf) ecloud contacts using bash/cli? I’ve tried wget -r -c --user --ask-password, but could not make it work.

Regain your privacy! Adopt /e/ the unGoogled mobile OS and online servicesphone

I don’t use a caldav cli client myself, but vdirsyncer looks solid to scrape from a carddav endpoint that nextcloud offers:

the curl should work if you provide it an active cookie (copy from your browser) or build the Authorization header yourself (you have to check if token/digest or basic auth is accepted):

curl '' -H 'Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=myuser; nc_token=<>; nc_session_id=<>; oc_sessionPassphrase=<>'

there’s a gui option to export, but I think you deliberately want to have it in a shell script…