curl gets all users as documents, grep retrieves documents _id , prefix sed strips org.couchdb.user: and sorts removes duplicates that come from the result of the view:
curl -s http://localhost:5984/_users/_all_docs | grep -o 'org.couchdb.user:[[:alnum:]]\+' | sed -n -e 's/org.couchdb.user:\(.*\)/\1/p' | sort -u
Please note that starting from version 1.2.0, if you had the Admin Party fixed on the server, you need to transfer the CouchDB administrator credentials to make such requests for the _users database.
source share