Skip to content

Commit 8cda7b7

Browse files
authored
docs: Update description for login command (#651)
1 parent ba62245 commit 8cda7b7

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

docs/login.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Login options:
1313

1414
Quickstart: run "box login -d" to sign in immediately. A browser window will open for authorization. Once access is granted, the environment is created and set as default — you can start running commands right away.
1515

16+
Headless environments: use --code (-c) if no browser is available. The CLI will display an authorize URL — visit it in an external browser, authorize and grant access to the app, then provide the state and authorization code back to the CLI when prompted.
17+
1618
* [`box login`](#box-login)
1719

1820
## `box login`
@@ -25,7 +27,8 @@ USAGE
2527
2628
FLAGS
2729
-c, --code
28-
Manually visit authorize URL and input code
30+
Manually provide state and authorization code instead of using a local callback server. Use this in headless
31+
environments where no browser is available — the CLI will display an authorize URL to visit externally.
2932
3033
-d, --default-box-app
3134
Use the Official Box CLI app flow and proceed directly to authorization.
@@ -75,6 +78,10 @@ DESCRIPTION
7578
7679
Quickstart: run "box login -d" to sign in immediately. A browser window will open for authorization. Once access is
7780
granted, the environment is created and set as default — you can start running commands right away.
81+
82+
Headless environments: use --code (-c) if no browser is available. The CLI will display an authorize URL — visit it in
83+
an external browser, authorize and grant access to the app, then provide the state and authorization code back to the
84+
CLI when prompted.
7885
```
7986

8087
_See code: [src/commands/login.js](https://github.com/box/boxcli/blob/v4.6.0/src/commands/login.js)_

src/commands/login.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,15 @@ OAuthLoginCommand.description =
476476
' (2) Your own Platform OAuth App\n' +
477477
' Enter your Client ID and Client Secret when prompted. Use --platform-app to skip the prompt.\n' +
478478
'\n' +
479-
'Quickstart: run "box login -d" to sign in immediately. A browser window will open for authorization. Once access is granted, the environment is created and set as default — you can start running commands right away.';
479+
'Quickstart: run "box login -d" to sign in immediately. A browser window will open for authorization. Once access is granted, the environment is created and set as default — you can start running commands right away.\n' +
480+
'\n' +
481+
'Headless environments: use --code (-c) if no browser is available. The CLI will display an authorize URL — visit it in an external browser, authorize and grant access to the app, then provide the state and authorization code back to the CLI when prompted.';
480482

481483
OAuthLoginCommand.flags = {
482484
...BoxCommand.minFlags,
483485
code: Flags.boolean({
484486
char: 'c',
485-
description: 'Manually visit authorize URL and input code',
487+
description: 'Manually provide state and authorization code instead of using a local callback server. Use this in headless environments where no browser is available — the CLI will display an authorize URL to visit externally.',
486488
default: false,
487489
}),
488490
name: Flags.string({

0 commit comments

Comments
 (0)