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
+33-49Lines changed: 33 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -240,35 +240,28 @@ Logout behavior:
240
240
#### Console Login (login)
241
241
242
242
```shell
243
-
ve login --profile [profile name]
244
-
# Specify a region to avoid the interactive prompt
245
-
ve login --profile [profile name] --region cn-beijing
246
-
# or cross-device login
247
-
ve login --profile [profile name] --region cn-beijing --remote
248
-
```
243
+
# Sign in with the default profile. If region is omitted, the CLI prompts for it
244
+
ve login
249
245
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:
246
+
# Recommended: specify profile and region; profile/region support -p/-r
247
+
ve login -p dev -r cn-beijing
251
248
252
-
```shell
253
-
profile: configuration profile name; optional; defaults to default
254
-
region: optional; when omitted, the CLI prompts for it and defaults to cn-beijing when you press Enter
255
-
remote: enables cross-device login mode; when set, the CLI prints a login URL and prompts forthe authorization code shownin the browser
256
-
endpoint-url: optional; overrides the sign-in service endpoint; defaults to https://signin.volcengine.com
249
+
# Use cross-device login for headless, remote-server, or container environments
250
+
ve login -p dev -r cn-beijing --remote
257
251
```
258
252
259
-
Login behavior:
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
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
265
-
- If the target profile already exists, the command reuses and overwrites that profile, updating its `mode` to `console-login`
266
-
- If the profile is already bound to a different `login-session`, the CLI prompts before replacing it
267
-
268
-
Usage notes:
269
-
- This is useful when you want temporary credentials obtained from your console identity without manually preparing AK/SK
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
271
-
- To isolate different console identities, use separate `--profile` values
253
+
This command signs in through the Volcengine Console using OAuth 2.0 + PKCE, caches temporary STS credentials locally, and lets later service commands reuse the temporary credentials from that profile.
254
+
255
+
Parameters:
256
+
- `--profile, -p`: configuration profile name; defaults to `default`
257
+
- `--region, -r`: region; when omitted, the CLI prompts for it and uses `cn-beijing`if you press Enter
258
+
- `--remote`: cross-device login; open the URL printed by the CLI in a browser, finish login, and paste the full authorization code shown in the browser back into the terminal
259
+
- `--endpoint-url`: sign-in service endpoint; defaults to `https://signin.volcengine.com` and normally does not need to be changed
260
+
261
+
Notes:
262
+
- After login, the profile is written with `mode`set to `console-login` and a `login-session`
263
+
- After logging in with a non-`default` profile, service commands do not automatically switch profiles; run `ve configure profile --profile dev` first
264
+
- Use `--remote` when the browser cannot redirect back to the machine running the CLI
272
265
273
266
End-to-end example:
274
267
@@ -286,38 +279,29 @@ ve ecs DescribeInstances
286
279
ve logout --profile dev
287
280
```
288
281
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
293
-
294
282
#### Console Logout (logout)
295
283
296
284
```shell
297
-
ve logout --profile [profile name]
298
-
# or clear all login credentials
285
+
# Log out the default profile
286
+
ve logout
287
+
288
+
# Log out a specific profile
289
+
ve logout -p dev
290
+
291
+
# Log out all Console Login profiles in the current configuration
299
292
ve logout --all
300
293
```
301
294
302
-
This commandlogs out of a console login session established via`ve login` and removes the locally cached temporary STS credentials. This is a purely local operation — no network requests are made to any server. Parameters:
295
+
This commandclears the locallogin state created by`ve login`. It removes locally cached credentials and clears the profile's `login-session`; it does not delete the profile or send a logout request to the server.
303
296
304
-
```shell
305
-
profile: configuration profile name; optional; defaults to default
306
-
all: remove cached login credentials for all console-login profiles; when set, --profile is ignored
307
-
```
297
+
Parameters:
298
+
- `--profile, -p`: configuration profile name; defaults to `default`
299
+
- `--all`: clear all `console-login` profiles in the current configuration; ignores `--profile`
308
300
309
-
Logout behavior:
310
-
- The default mode logs out a single profile: the CLI locates and removes the cached token file under `~/.volcengine/login/cache/` based on the `login-session` recorded in the profile, and clears the `login-session` field in the configuration
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
312
-
- Only profiles using `console-login` mode can be logged out with this command; the command returns an error for AK or SSO profiles
313
-
- If the profile does not have an active login session (`login-session` is empty), the command prints a message and exits normally
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`
316
-
317
-
Usage notes:
318
-
- On shared devices, it is recommended to run `ve logout` after you finish using the CLI
319
-
- To thoroughly clean all login caches (e.g., for troubleshooting or device handover), use `ve logout --all`
320
-
- After logout, run `ve login` to re-establish a login session when needed
301
+
Notes:
302
+
- `ve logout` without `--profile` only handles the `default` profile; it does not automatically log out `current`
303
+
- This command only applies to `console-login` profiles; AK/SSO profiles are not affected
304
+
- Run `ve login` again when you need to use Console Login credentials after logout
0 commit comments