From 237f0c5704d68080ba4149968a84227c7a345b83 Mon Sep 17 00:00:00 2001 From: xka5h <74259424+xka5h@users.noreply.github.com> Date: Thu, 3 Mar 2022 16:15:18 -0600 Subject: [PATCH] updated CLI connection options, including addr (#1884) --- website/content/docs/api-clients/cli.mdx | 65 +++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/website/content/docs/api-clients/cli.mdx b/website/content/docs/api-clients/cli.mdx index 8edb639a0..e5ed36704 100644 --- a/website/content/docs/api-clients/cli.mdx +++ b/website/content/docs/api-clients/cli.mdx @@ -11,6 +11,35 @@ Boundary's CLI has predictable behavior throughout its various commands. This page details the common patterns used in order to help users make better use of the CLI. +## CLI Command Structure + +There are a number of command and subcommand options available. +To see all available command options, run `boundary -h` +and to see all available subcommand options run `boundary -h`. + +Below is the typical structure for most Boundary CLI commands: + +```text +boundary [options] [args] +``` + +- `options` - [Client](/docs/api-clients/cli#client-options) and [connection](/docs/api-clients/cli#connection-options) options to specify additional settings +- `args` - API arguments specific to the operation + +#### Examples: + +The following shows use of the [`-addr`](/docs/api-clients/cli#addr) flag to specify which Boundary controller to send the request to. + +```shell-session +$ boundary authenticate password \ + -addr=https://boundary.example.com:9200 + -auth-method-id=ampw_1234567890 \ + -login-name=admin \ + -password=password +``` + +Instead of specifying the `-addr` flag for every command, you can set an environment variable `BOUNDARY_ADDR=https://boundary.controller.com:9200`. + ## Completion Before detailing how parameters work, it's useful to note that Boundary's CLI @@ -154,7 +183,41 @@ mind that this is not a direct translation to database `NULL` semantics! ### Connection Options Every command that results in an API call contains a set of flags that control -connection options, which control TLS and other settings for the connection. +connection options, which control TLS and other settings for the connection. +You can also run `boundary dev -h` to see the available connection options. + +- `-addr=`: Address of the Boundary controller, as a complete URL (e.g. + https://boundary.example.com:9200). Instead of passing the `-addr` argument with every command, + the `BOUNDARY_ADDR` environment variable can be set. In both cases, the value denotes the address + of the Boundary environment (specifically the controller) you wish to send CLI commands to. + +- `-ca-cert=`: Path on the local disk to a single PEM-encoded CA certificate to + verify the Controller or Worker's server's SSL certificate. This + takes precedence over -ca-path. This can also be specified via the + `BOUNDARY_CACERT` environment variable. + +- `-ca-path=`: Path on the local disk to a directory of PEM-encoded CA certificates to + verify the SSL certificate of the Controller. This can also be specified + via the `BOUNDARY_CAPATH` environment variable. + +- `-client-cert=`: Path on the local disk to a single PEM-encoded CA certificate to use + for TLS authentication to the Boundary Controller. If this flag is + specified, -client-key is also required. This can also be specified via + the `BOUNDARY_CLIENT_CERT` environment variable. + +- `-client-key=`: Path on the local disk to a single PEM-encoded private key matching the + client certificate from -client-cert. This can also be specified via the + `BOUNDARY_CLIENT_KEY` environment variable. + +- `-tls-insecure`: Disable verification of TLS certificates. Using this option is highly + discouraged as it decreases the security of data transmissions to + and from the Boundary server. The default is false. This can also be + specified via the `BOUNDARY_TLS_INSECURE` environment variable. + +- `-tls-server-name=`: Name to use as the SNI host when connecting to the Boundary server + via TLS. This can also be specified via the `BOUNDARY_TLS_SERVER_NAME` + environment variable. + ### Client Options