go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.44k stars 985 forks source link

Ability to update email using the CLI #2175

Open TobyGiacometti opened 1 month ago

TobyGiacometti commented 1 month ago

Welcome

How do you use lego?

Binary

Detailed Description

It would be great if the email update functionality (https://github.com/go-acme/lego/pull/1002) could be exposed through the CLI. The interface could look as follows:

NAME:
   lego account - Update account information.

USAGE:
   lego account [command options] [arguments...]

OPTIONS:
   --account value, -a value  Email of the account that should be updated.
   --email value, -m value    New email for the account.
   --help, -h                 show help

While I would prefer to use an interface that makes use of positional arguments for required parameters, the interface is built around options to keep it consistent with the rest of the lego CLI interface. Since the --server option is global, it is not included in the interface of the command. While --email is also a global option, it makes sense to list it explicitly.

Since lego uses emails as account identifier, storage data should be updated as well:

Once done, the user should be reminded to update the --email option for all commands.