Improving the command line UI of gpg

Dashamir Hoxha dashohoxha at
Tue Jul 24 00:22:57 CEST 2018

On Mon, Jul 23, 2018 at 9:34 PM Doron Behar <doron.behar at> wrote:

> Hello GnuPG developers,
> I would like to discuss a subject that has been really bothering me and
> I hope I'm not the only one.

I am not a genuine GnuPG developer, I am rather a user.
I have noticed it as well that the commands and sub-commands of `gpg`
are not clearly distinguishable from their options, and this makes it
to use (or to understand a command in a script). So I think that your
is a good idea.

I also have noticed that `gpg` does more things that it needs to do. For
why should it do compression, when there are lots of tools out there for
compression? But maybe I am missing something, since I am not an expert
on cryptographic things.

> I've been using `gpg` for a while. Honestly, I must say it's
> command-line user interface is super uncomfortable. Let me explain:
> The problem resides in the fact that it accepts only `options` (starting
> with `--` or `-`. Shell completion engines are better built for commands
> that accept both options and commands. This makes it easier for the user
> (getting help either from the shell tab completion engine or the
> program's manual) to distinguish between commands and the optional
> flags.
> Inspired by the (super comfortable IMO) command line user interface of
> `git`, I've had a vision for a new set of `gpg` subcommands and the
> corresponding arguments and options I think naming them so would be
> comfortable enough. I've attached a text file with the subcommands and
> the arguments and options they should accept. I hope it's format is
> clear.
> I would really like to improve the usability of `gpg` and I think this
> is a crucial step towards making it more user friendly. From reading the
> source code, I've noticed GnuPG implements it's own command line
> arguments parsing. Maybe it'll be better to use a standard library like
> `argp.h`?
> This obviously mean that it would make the next version of `gpg`
> incompatible with the older versions but I really think it's worth the
> effort.

Maybe it can preserve the backwards compatibility, but the code will have
to be a little bit more complex.

> I'd love to hear your opinions.

By the way, can you have a look at this:
It is an attempt to make GnuPG easier for beginners, and it uses the model
of sub-commands that you describe.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Gnupg-devel mailing list