Regenerate local_api_credentials.yaml?

Is there a way to regenerate the credentials in local_api_credentials.yaml and online_api_credentials.yaml ?

I would think a fairly common requirement would be to clone containers, overwrite the credentials as a new server, then register with a central LAPI.
I tried dpkg-reconfigure crowdsec which seemed to ask the right questions, but the files above are still empty.

cscli machines add -a would do the trick (if LAPI is on the same machine), otherwise cscli machines register (and you need to accept it on LAPI)

Thanks @thibault just figured it out:

cscli capi register
cscli lapi register

Must have url: http://lapi_IP:port in the local_api_credentials.yaml file