diff --git a/docs/dev/tools/cli.md b/docs/dev/tools/cli.md index 302fa777ed..685d82e257 100644 --- a/docs/dev/tools/cli.md +++ b/docs/dev/tools/cli.md @@ -107,7 +107,7 @@ to later update the Viam CLI tool on macOS, run `brew upgrade viam`. Once you have [installed the Viam CLI](#install), you must authenticate your CLI session with Viam in order to run CLI commands. -You can authenticate your CLI session using either a personal access token, or an organization, location, or machine part API key. +You can authenticate your CLI session using a personal access token, a profile, or an organization, location, or machine part API key. - To authenticate your CLI session using a personal access token: @@ -133,6 +133,19 @@ An authenticated session is valid for 24 hours, unless you explicitly [log out]( After the session expires or you log out, you must re-authenticate to use the CLI again. +## CLI profiles + +You can also authenticate your CLI session with profiles which allow you to switch between using different privileges. +To create a profile, run the following command: + +```sh {class="command-line" data-prompt="$"} +viam profiles add --profile-name=default --key-id= --key= +``` + +To use a profile to authenticate a command, pass the `--profile` flag. +By default, the Viam CLI does not use a profile. +To use a specific profile by default, set the environment variable `VIAM_CLI_PROFILE_NAME` to the profile name. + ### Create an organization API key To use an API key to authenticate your CLI session, you must create one. @@ -1626,8 +1639,8 @@ You can pass global options after the `viam` CLI keyword with any command. | Global option | Description | | ------------- | ----------- | -| `--debug` | Enable debug logging (default: false). | -| `--disable-profiles`, `disable-profile` | Disable usage of [profiles](#profiles), falling back to default (false) behavior. | -| `--help`, `-h` | Show help (default: false). | +| `--debug` | Enable debug logging. Default: `false`. | +| `--disable-profiles`, `disable-profile` | Disable usage of [profiles](#profiles), falling back to default (false) behavior. Default: `false`. | +| `--help`, `-h` | Show help. Default: `false`. | | `--profile` | Specify a particular [profile](#profiles) for the current command. | -| `--quiet`, `-q` | Suppress warnings (default: false). | +| `--quiet`, `-q` | Suppress warnings. Default: `false` |