When you create a new identity and don't provide a name, the CLI will assume main as a name but it does not check if the name already exists, only after providing the password and encrypting the data (which can take a few seconds). Then it fails with an error (see the output below).
It would be better to check if the name exists at the beginning instead.
% node dist/index.js identity create
You have not defined password with the "--password" option.
If you want to create disposable keypair, use "only-keypair" option
? Please provide a password [hidden]
? Please repeat the password [hidden]
Identity 'main' already exist.
When you create a new identity and don't provide a name, the CLI will assume
main
as a name but it does not check if the name already exists, only after providing the password and encrypting the data (which can take a few seconds). Then it fails with an error (see the output below).It would be better to check if the name exists at the beginning instead.