@@ -107,7 +107,7 @@ to later update the Viam CLI tool on macOS, run `brew upgrade viam`.
107
107
108
108
Once you have [ installed the Viam CLI] ( #install ) , you must authenticate your CLI session with Viam in order to run CLI commands.
109
109
110
- You can authenticate your CLI session using either a personal access token, or an organization, location, or machine part API key.
110
+ You can authenticate your CLI session using a personal access token, a profile , or an organization, location, or machine part API key.
111
111
112
112
- To authenticate your CLI session using a personal access token:
113
113
@@ -133,6 +133,19 @@ An authenticated session is valid for 24 hours, unless you explicitly [log out](
133
133
134
134
After the session expires or you log out, you must re-authenticate to use the CLI again.
135
135
136
+ - To authenticate using a profile:
137
+
138
+ ## CLI profiles
139
+
140
+ You can also authenticate your CLI session with profiles which allow you to switch between using different privileges.
141
+
142
+ ``` sh {class="command-line" data-prompt="$" data-output="2-10"}
143
+ viam profiles add --profile-name=default --key-id=< api-key-id> --key=< api-key>
144
+ ```
145
+
146
+ To specify a profile for a command use the ` --profile ` flag.
147
+ To set a profile for a shell session, set the environment variable ` VIAM_CLI_PROFILE_NAME ` to your profile name.
148
+
136
149
### Create an organization API key
137
150
138
151
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.
1626
1639
<!-- prettier-ignore -->
1627
1640
| Global option | Description |
1628
1641
| ------------- | ----------- |
1629
- | ` --debug ` | Enable debug logging (default: false) . |
1630
- | ` --disable-profiles ` , ` disable-profile ` | Disable usage of [ profiles] ( #profiles ) , falling back to default (false) behavior. |
1631
- | ` --help ` , ` -h ` | Show help (default: false) . |
1642
+ | ` --debug ` | Enable debug logging. Default: ` false ` . |
1643
+ | ` --disable-profiles ` , ` disable-profile ` | Disable usage of [ profiles] ( #profiles ) , falling back to default (false) behavior. Default: ` false ` . |
1644
+ | ` --help ` , ` -h ` | Show help. Default: ` false ` . |
1632
1645
| ` --profile ` | Specify a particular [ profile] ( #profiles ) for the current command. |
1633
- | ` --quiet ` , ` -q ` | Suppress warnings (default: false). |
1646
+ | ` --quiet ` , ` -q ` | Suppress warnings. Default: ` false ` |
0 commit comments