You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.EN.MD
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,32 +241,55 @@ Logout behavior:
241
241
242
242
```shell
243
243
ve login --profile [profile name]
244
+
# Specify a region to avoid the interactive prompt
245
+
ve login --profile [profile name] --region cn-beijing
244
246
# or cross-device login
245
-
ve login --profile [profile name] --remote
247
+
ve login --profile [profile name] --region cn-beijing --remote
246
248
```
247
249
248
250
This command signs in through the Volcengine Console using OAuth 2.0 + PKCE and caches temporary STS credentials locally for subsequent CLI calls. Parameters:
249
251
250
252
```shell
251
253
profile: configuration profile name; optional; defaults to default
252
-
region: optional; when omitted, the CLI first reuses the region already configured on the target profile
254
+
region: optional; when omitted, the CLI prompts for it and defaults to cn-beijing when you press Enter
253
255
remote: enables cross-device login mode; when set, the CLI prints a login URL and prompts forthe authorization code shownin the browser
254
256
endpoint-url: optional; overrides the sign-in service endpoint; defaults to https://signin.volcengine.com
255
257
```
256
258
257
259
Login behavior:
258
-
- The default mode is local login: the CLI starts a local callback server, tries to open your browser automatically, and waits for the browser redirect after authentication
259
-
- With `--remote`, the CLI uses cross-device login: this is suitable for headless environments or machines that cannot open a browser locally. The CLI prints a login URL, you complete authentication on any device, and then paste the authorization code back into the terminal
260
+
- The default mode is local login: the CLI starts a local callback server, prints an authorization URL, tries to open your browser automatically, and waits forthe browser redirect after authentication. If the browser does not open, visit the URL printedin the terminal manually
261
+
- If `--region` is omitted, the CLI prompts with `Please enter region [cn-beijing]: `. Press Enter to use `cn-beijing`;for scripts and automation, pass `--region` explicitly
262
+
- With `--remote`, the CLI uses cross-device login: this is suitable forheadless environments or machines that cannot open a browser locally. The CLI prints a login URL, you complete authentication on any device, and then paste the complete base64 authorization code shownin the browser back into the terminal
260
263
- After a successful login, the CLI stores the profile with `mode`set to `console-login` and records the `login-session`; token cache files are stored under `~/.volcengine/login/cache/`
264
+
- You can override the login cache directory with the `VOLCENGINE_LOGIN_CACHE_DIRECTORY` environment variable, which is useful for multi-user machines or CI isolation
261
265
- If the target profile already exists, the command reuses and overwrites that profile, updating its `mode` to `console-login`
262
266
- If the profile is already bound to a different `login-session`, the CLI prompts before replacing it
263
-
- If `--region` is not explicitly provided and the profile already has a region, the CLI reuses that value automatically
264
267
265
268
Usage notes:
266
269
- This is useful when you want temporary credentials obtained from your console identity without manually preparing AK/SK
267
270
- If the local session expires and a refresh token is available in cache, the CLI will try to refresh it automatically;if refresh fails, run `ve login` again
268
271
- To isolate different console identities, use separate `--profile` values
269
272
273
+
End-to-end example:
274
+
275
+
```shell
276
+
# 1. Sign in and write the dev profile
277
+
ve login --profile dev --region cn-beijing
278
+
279
+
# 2. If dev is not the current default profile, switch the active profile first
280
+
ve configure profile --profile dev
281
+
282
+
# 3. Service commands use the console-login temporary credentials from the current profile
283
+
ve ecs DescribeInstances
284
+
285
+
# 4. When finished, clear the local login state
286
+
ve logout --profile dev
287
+
```
288
+
289
+
Notes:
290
+
- On the first login, if`current` is empty in the configuration file, the CLI sets the logged-in profile as the current default profile automatically. If another current profile already exists, switch manually with `ve configure profile --profile [profile name]`
291
+
- When subsequent service commands use this profile, the CLI reads temporary STS credentials from the local cache. If the credentials are close to expiration and a refresh token exists, the CLI refreshes them automatically
292
+
- `ve logout` only clears the local cache and the `login-session`in the configuration; it does not delete the whole profile
270
293
271
294
#### Console Logout (logout)
272
295
@@ -288,7 +311,8 @@ Logout behavior:
288
311
- With `--all`, the CLI iterates all profiles in the configuration, identifies those using `console-login` mode with an active `login-session`, removes the corresponding cache file for each via SHA-1 lookup, and clears the `login-session` field. Failure to clean one profile does not affect the others
289
312
- Only profiles using `console-login` mode can be logged out with this command; the command returns an error for AK or SSO profiles
290
313
- If the profile does not have an active login session (`login-session` is empty), the command prints a message and exits normally
291
-
- After logout, credentials that have already been loaded by other tools may remain valid until they expire (typically within 15 minutes)
314
+
- `ve logout` is a purely local cleanup operation and does not send a logout request to the server. After logout, credentials that have already been loaded by other tools may remain valid until they expire (typically within 15 minutes)
315
+
- Logout only clears the local token cache and the profile's `login-session`; it does not delete the whole profile or clear other fields such as `region`
292
316
293
317
Usage notes:
294
318
- On shared devices, it is recommended to run `ve logout` after you finish using the CLI
0 commit comments