Dear Livia,
I'm sorry for the slight misunderstanding of your question.
You will have to download OpenStack RC file and source it in order to equip your system in OS environmental variables. After that you may easily perform a keycloak token generation using curl.
For more informations regarding sourcing OpenStack RC file, please refer to
https://creodias.eu/-/how-to-install-openstackclient-linux-Best regards,
Mateusz Sykucki