gpg-connect-agent is invoked this way:
gpg-connect-agent [options] [commands]
The following options may be used:
Output additional information while running.
Try to be as quiet as possible.
Set the name of the home directory to dir. If this option is not
used, the home directory defaults to ~/.gnupg. It is only
recognized when given on the command line. It also overrides any home
directory stated through the environment variable
(on Windows systems) by means of the Registry entry
On Windows systems it is possible to install GnuPG as a portable application. In this case only this command line option is considered, all other ways to set a home directory are ignored.
To install GnuPG as a portable application under Windows, create an empty file named gpgconf.ctl in the same directory as the tool gpgconf.exe. The root of the installation is then that directory; or, if gpgconf.exe has been installed directly below a directory named bin, its parent directory. You also need to make sure that the following directories exist and are writable: ROOT/home for the GnuPG home and ROOT/usr/local/var/cache/gnupg for internal cache files.
Specify the agent program to be started if none is running. The
default value is determined by running
gpgconf with the
option --list-dirs. Note that the pipe symbol (
used for a regression test suite hack and may thus not be used in the
Specify the directory manager (keyserver client) program to be started if none is running. This has only an effect if used together with the option --dirmngr.
Connect to a running directory manager (keyserver client) instead of to the gpg-agent. If a dirmngr is not running, start it.
Connect to socket name assuming this is an Assuan style server. Do not run any special initializations or environment checks. This may be used to directly connect to any Assuan style socket server.
Take the rest of the command line as a program and it’s arguments and
execute it as an Assuan server. Here is how you would run
gpg-connect-agent --exec gpgsm --server
Note that you may not use options on the command line in this case.
When using -S or --exec,
connects to the Assuan server in extended mode to allow descriptor
passing. This option makes it use the old mode.
Do not start the gpg-agent or the dirmngr if it has not yet been started.
Run the commands from file at startup and then continue with the regular input method. Note, that commands given on the command line are executed after this file.
Run the command
/subst at startup.
Print data lines in a hex format and the ASCII representation of non-control characters.
Decode data lines. That is to remove percent escapes but make sure that a new line always starts with a D and a space.