Skip to content

Securely Passing Parameters via the Command Line

In addition to passing arguments via the Command Line, you can also provide parameters via the standard input stream using the --ask-extra-args-as-json parameter. This approach is preferred when you want to pass sensitive data, such as user credentials, to the pcoip-client process. The --ask-extra-args-as-json parameter accepts arguments as JSON strings, thereby ensuring that user data is prevented from being recorded in the shell history.

To launch the client, using the --ask-extra-args-as-json parameter:

  1. From the CLI, run the following command:

    pcoip-client --ask-extra-args-as-json
    2. When the following prompt appears, provide the required arguments as a JSON string:

    Arguments should be specified with '-' prefixes and flags specified under a 'flags' section.
    For example: {"--username": "alice","flags": ["--use-egl"]}
    For a more detailed description of the format, please see the help by using flag --help.
    Please enter extra arguments (as JSON):
    These arguments are passed through the standard input of the `pcoip-client process, and are not recorded in the command history or process list.

JSON String Format

The JSON string should consist of key value pairs, such that the keys are the names of the command line parameters and the associated values are the values of the parameters.

  • The keys in the JSON object must be strings enclosed within quotes.
  • The parameters may be specified in long form, for example, --username. They can also be specified as short form. For example, -u.
  • Parameters can be of the following types: string, boolean, or numeric.
  • The JSON object cannot contain new lines. It can contain spaces and tabs.
  • Flags such as --help and --use-egl that have no associated values can be included as values in the special "flags" array.

Here are some examples of valid JSON strings, which can be passed to the client from standard input of the pcoip-client process:

{ "-u": "<username>", "-p": "<password>", "--connection-broker": "<connectionManager>", "--domain": "<domain>", "--log-level": 3 }
{ "--connect-tag": "<encodedConnectTag>", "--session-id": "<encodedSessionId>" }
{ "flags" : ["--use-egl"] }