On Linux running era5cli config --uid ... --key "..." will write ~/.config/era5cli/cds_key.txt file with -rw-r--r-- permission.
As this file contains a secret it should not be readable by others on the same system.
Can the file be written with stricter permissions like -rw-------?