@bluestep-systems/b6p-cli 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +92 -19
- package/dist/cli.js +325 -313
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.8.0] — 2026-12-05
|
|
11
|
+
|
|
12
|
+
Requires b6p-core 1.9.1 (bundled).
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`b6p auth login`** signs b6p in through the browser, modelled on `gh auth login`: it prints a one-time code,
|
|
17
|
+
offers to open the gateway's `/device` page ("Press Enter to open … in your browser..."), waits while you allow it
|
|
18
|
+
there, then stores a token with the scopes BlueStep's tools need (`mcp`, `kb:read`, `kb:push`, `registry:read`,
|
|
19
|
+
`tokens:self`) for 90 days. Over SSH, with no display, without a terminal or with `--no-browser` it prints the
|
|
20
|
+
page's address instead; `--yes` skips the Enter prompt. The browser opener runs by full path only (never one in
|
|
21
|
+
the current folder or on `PATH`). The code is never put in the address. `--hostname <host>` signs in to another
|
|
22
|
+
gateway; nothing changes while it waits, and it becomes the configured one together with its token only when the
|
|
23
|
+
sign-in succeeds. `--with-token` stores a piped token, as `auth set`
|
|
24
|
+
does; `--web` is accepted. Already signed in, it asks first on a terminal. A new sign-in revokes the token the
|
|
25
|
+
last sign-in made; a pasted token is left live. Every way a sign-in can end is worded: denied in the browser, the
|
|
26
|
+
code expired, too many sign-ins from this network (with how long to wait), a gateway that doesn't offer it yet
|
|
27
|
+
("use `b6p auth set`"), and Ctrl-C (exit 130; when the approval had already arrived, its token is stored and b6p
|
|
28
|
+
says it is signed in anyway, exit 0); Ctrl-C also cancels the Enter prompt. `--json` prints the result on stdout and keeps the code on stderr. Then it offers git's credential
|
|
29
|
+
helper, as `auth set` does.
|
|
30
|
+
- **`b6p auth logout [--revoke]`** revokes the token `auth login` made and forgets it. A pasted token is only
|
|
31
|
+
forgotten unless `--revoke`. Offline, it forgets the token and says it stays live until it expires or is revoked
|
|
32
|
+
on My Account (exit 0).
|
|
33
|
+
- **`b6p auth refresh`** renews the sign-in's token now, to a fresh 90 days.
|
|
34
|
+
- **Renewal**: before a gateway command (`kb`, `marketplace`, `auth token`) and before script work (`script push`,
|
|
35
|
+
`pull`, `audit`, `deploy`, `setup`), b6p renews a sign-in's token when 30
|
|
36
|
+
days or fewer are left, at most once a day. Silent when it works; one warning line when it doesn't, and the
|
|
37
|
+
command goes on. A token that was renewed but could not be stored is never printed: the command fails and names
|
|
38
|
+
the `0600` recovery file b6p kept it in (`~/.b6p/recovered-token-<time>`). Ctrl-C waits until a renewal's new
|
|
39
|
+
token is stored. `auth mcp-headers` and `auth git-credential` never renew.
|
|
40
|
+
- **`b6p auth status`** says how b6p is signed in: browser sign-in (account, token name, scopes, expiry, "renews
|
|
41
|
+
itself while you use b6p") or a pasted token, with the token shown only as its masked prefix (`b6p_g_************`).
|
|
42
|
+
`--json` gains `method`, `account`, `alias`, `expiresAt` and `signIn`.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- **New token prefixes.** `auth set`, its hint and every error and helper line accept and name `b6p_g_` (global
|
|
47
|
+
accounts), `b6p_t_` (tenant users) and the older `b6pt_`. `b6p_o_` is not a platform token and is refused.
|
|
48
|
+
- A new secret that could not be stored, or came in a malformed answer (`auth token create`/`rotate`, login,
|
|
49
|
+
renewal, refresh), is no longer printed: the failure names core's recovery file (`recoveryFile` under `--json`,
|
|
50
|
+
which replaces `secret` on those failure bodies).
|
|
51
|
+
- A refused token from a browser sign-in says the sign-in has ended and to run `b6p auth login`; a missing or
|
|
52
|
+
malformed token points at `b6p auth login` as well as `b6p auth set`.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- Ctrl-C at a line prompt on a terminal exits 130, as it does at the masked token prompt, instead of reading as the
|
|
57
|
+
end of input (exit 1).
|
|
58
|
+
|
|
10
59
|
## [1.7.0] — 2026-12-05
|
|
11
60
|
|
|
12
61
|
Requires b6p-core 1.8.1 (bundled).
|
package/README.md
CHANGED
|
@@ -63,19 +63,86 @@ The npm install above is unchanged and remains the recommended path wherever Nod
|
|
|
63
63
|
|
|
64
64
|
## Signing in
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
place it is kept: BlueStep's AI tools get it from b6p for the gateway MCP ([below](#the-gateway-mcp-gets-its-token-from-b6p)),
|
|
68
|
-
so give it the `mcp` and `kb:read` scopes as well as what b6p's commands need. To make one: **Tools → Organization Admin → Super → Global Users → Access Tokens → Create
|
|
69
|
-
New Token**.
|
|
66
|
+
Sign b6p in through your browser, the way `gh auth login` does:
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
```console
|
|
69
|
+
$ b6p auth login
|
|
70
|
+
! First copy your one-time code: WDJB-MJHT
|
|
71
|
+
Press Enter to open gateway.bluestep.net in your browser...
|
|
72
|
+
⠋ Waiting for you to approve in the browser (expires in 10 minutes)…
|
|
73
|
+
✓ Signed in to gateway.bluestep.net as you@example.com
|
|
74
|
+
✓ Token "b6p on your-laptop 2026-12-05 14:03" stored.
|
|
75
|
+
It expires 2027-03-05 and renews itself while you use b6p.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
On the gateway's `/device` page you sign in with Microsoft, type the code, check what is asking ("b6p on
|
|
79
|
+
your-laptop") and choose **Allow**. Type the code yourself: it is never put in a link, and nobody at BlueStep will
|
|
80
|
+
ever ask you for one. The token b6p gets has the scopes BlueStep's tools need (`mcp`, `kb:read`, `kb:push`,
|
|
81
|
+
`registry:read`, `tokens:self`), lasts 90 days and is renewed by b6p before it runs out (see
|
|
82
|
+
[Renewal](#renewal)), so you sign in again only after 60 days without using b6p.
|
|
83
|
+
|
|
84
|
+
Over SSH, with no display, without a terminal, with no browser opener in a system folder, or with `--no-browser`,
|
|
85
|
+
b6p prints the page's address instead of offering to open it: open it in a browser on any device. `--yes` skips the
|
|
86
|
+
Enter prompt and opens the browser at once. b6p runs the opener by its full path only (`/usr/bin/open`, `xdg-open`
|
|
87
|
+
from the system folders, `%SystemRoot%\System32\rundll32.exe`, or `$BROWSER` when it is a full path), never one found
|
|
88
|
+
in the current folder or on `PATH`. Ctrl-C stops waiting (exit `130`); the code expires on its
|
|
89
|
+
own after 10 minutes. If the approval had already arrived when you pressed Ctrl-C, its token is stored: b6p says it
|
|
90
|
+
is signed in anyway (the token it replaced was not revoked) and exits `0`.
|
|
91
|
+
|
|
92
|
+
| Flag | |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `--hostname <host>` | Sign in to another gateway (`gateway.myassn.com`, or an `https://` address). Nothing changes while it waits; it becomes the configured `gatewayUrl`, together with its token, only when the sign-in succeeds. Not with `--with-token` |
|
|
95
|
+
| `--no-browser` | Print the address; never offer to open a browser |
|
|
96
|
+
| `--with-token` | Read a token from stdin and store it, as `b6p auth set` does |
|
|
97
|
+
| `--web` | Accepted for gh's muscle memory; the browser is the only way |
|
|
98
|
+
|
|
99
|
+
Already signed in, `b6p auth login` asks first on a terminal ("Sign in again?", default no; for a pasted token
|
|
100
|
+
"Replace it with a browser sign-in?", default yes); `--yes`, `--json` or no terminal go on. A new sign-in revokes
|
|
101
|
+
the token the last sign-in made (it says so, and says whose it was when another account approves); a token you
|
|
102
|
+
pasted is left live, since it may be in use elsewhere. `--json` prints the result (gateway, account, token name and
|
|
103
|
+
id, scopes, expiry, what became of the token it replaced, `gatewayChanged`, `git`) on stdout; the code and address
|
|
104
|
+
still go to stderr. A failed sign-in's body has `reason` (`unavailable`, `denied`, `expired`, `rate-limited`,
|
|
105
|
+
`aborted`), `retryAfterSeconds` and `signedIn`.
|
|
106
|
+
|
|
107
|
+
Who can't sign in this way yet: an account without a linked Microsoft identity, a tenant's own user, or a gateway
|
|
108
|
+
that doesn't offer it ("This gateway doesn't offer device sign-in yet; use `b6p auth set`"). For them, and for CI,
|
|
109
|
+
store a token from My Account → Access Tokens with:
|
|
72
110
|
|
|
73
111
|
```bash
|
|
74
112
|
b6p auth set
|
|
75
113
|
```
|
|
76
114
|
|
|
77
|
-
|
|
78
|
-
|
|
115
|
+
A platform token begins `b6p_g_` (a global account's), `b6p_t_` (a tenant user's) or `b6pt_` (older tokens); all
|
|
116
|
+
three are accepted. `b6p_o_` tokens are not platform tokens and are refused. b6p is the one place the token is kept:
|
|
117
|
+
BlueStep's AI tools get it from b6p for the gateway MCP ([below](#the-gateway-mcp-gets-its-token-from-b6p)), so a
|
|
118
|
+
pasted token needs the `mcp` and `kb:read` scopes as well as what b6p's commands need. A `401` usually means the
|
|
119
|
+
token expired or its account lost access, not that it is the wrong kind of token.
|
|
120
|
+
|
|
121
|
+
### Signing out
|
|
122
|
+
|
|
123
|
+
```console
|
|
124
|
+
$ b6p auth logout
|
|
125
|
+
✓ Signed out of gateway.bluestep.net (you@example.com).
|
|
126
|
+
Token "b6p on your-laptop 2026-12-05 14:03" revoked.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`b6p auth logout` revokes the token `b6p auth login` made (with that token's own `tokens:self`) and forgets it.
|
|
130
|
+
A pasted token is only forgotten, since it may be in use elsewhere; `--revoke` revokes it too. When the gateway
|
|
131
|
+
can't be reached the token is forgotten anyway and b6p says it stays live until it expires or you revoke it on My
|
|
132
|
+
Account (exit `0`, as gh). `b6p auth clear` forgets the token and never revokes anything.
|
|
133
|
+
|
|
134
|
+
### Renewal
|
|
135
|
+
|
|
136
|
+
Before a gateway command (`kb`, `marketplace`, `auth token`) and before script work that uses the token (`script
|
|
137
|
+
push`, `pull`, `audit`, `deploy`, `setup`), b6p renews a browser sign-in's token when 30 days or
|
|
138
|
+
fewer are left: a fresh 90 days, at most one attempt a day on a computer. It says nothing when that works; when it
|
|
139
|
+
fails, one warning line, and the command goes on with the token it has. If the token was renewed but the new one
|
|
140
|
+
could not be stored, the command fails and says where b6p kept it: a new file `~/.b6p/recovered-token-<time>`
|
|
141
|
+
readable only by you. Store it with `b6p auth set < <that file>` and delete the file. b6p never prints such a token
|
|
142
|
+
(only when no file could be written and stdout is your terminal, as the last resort). Ctrl-C during a renewal waits
|
|
143
|
+
until the new token is stored. `b6p auth refresh` renews now, whatever is left. A pasted token is never renewed
|
|
144
|
+
(`b6p auth token rotate --days` renews a refreshable one by hand). The MCP header helper and git's credential helper
|
|
145
|
+
never renew: a renewal revokes the old secret at once, which would cut the connection that asked.
|
|
79
146
|
|
|
80
147
|
### The gateway MCP gets its token from b6p
|
|
81
148
|
|
|
@@ -164,8 +231,11 @@ platform; the verbs beneath it act on that part.
|
|
|
164
231
|
|
|
165
232
|
| Command | Purpose |
|
|
166
233
|
|---|---|
|
|
167
|
-
| `b6p auth
|
|
168
|
-
| `b6p auth
|
|
234
|
+
| `b6p auth login [--hostname <host>] [--no-browser] [--with-token]` | Sign in through the browser with a one-time code ([details](#signing-in)) |
|
|
235
|
+
| `b6p auth logout [--revoke]` | Revoke the token `auth login` made and forget it; a pasted token only with `--revoke` ([details](#signing-out)) |
|
|
236
|
+
| `b6p auth refresh` | Renew the token `auth login` made now, to a fresh 90 days ([details](#renewal)) |
|
|
237
|
+
| `b6p auth set` | Set or update the access token (paste one from My Account; for CI and accounts that can't use `auth login`) |
|
|
238
|
+
| `b6p auth status` | Report how b6p is signed in (browser sign-in or pasted, account, token name, scopes, expiry) and whether git is set up to use it (never prompts, offline) |
|
|
169
239
|
| `b6p auth status --check` | Also ask the gateway whether it takes the token for BlueStep's tools: live, with the `mcp` and `kb:read` scopes; its expiry and whether it is refreshable. Exits `1` when not ([details](#checking-the-token-with-the-gateway)) |
|
|
170
240
|
| `b6p auth setup-git` | Set git to use the token for plain `git pull` and `git push` ([details](#plain-git-pull-and-git-push)) |
|
|
171
241
|
| `b6p auth setup-git --remove` | Take b6p's entries out of your git config |
|
|
@@ -179,9 +249,9 @@ platform; the verbs beneath it act on that part.
|
|
|
179
249
|
`auth token` manages only your **own** tokens and needs the `tokens:self` scope. `create` and `rotate`
|
|
180
250
|
print the new secret **once**, alone on stdout (so `TOKEN=$(b6p auth token create …)` captures it), with
|
|
181
251
|
the details and a "store it now" note on stderr. Under `--json` the secret is the top-level `secret`
|
|
182
|
-
field of the body, on success (`create`, `rotate`)
|
|
183
|
-
|
|
184
|
-
and `stored
|
|
252
|
+
field of the body, on success (`create`, `rotate`). A new secret that could not be stored, or came in a malformed
|
|
253
|
+
answer, is never printed: the command fails and names the `0600` recovery file b6p kept it in (`recoveryFile` in
|
|
254
|
+
the `--json` body, with `error`, `errors`, `operation` and `stored`). A new token's
|
|
185
255
|
scopes can never exceed the token b6p is using. The default lifetime is 90 days, or until the token b6p is using expires if that comes first (the command says so and gives the date); `--expires 30d`, a date
|
|
186
256
|
(`2027-03-01`, the start of that day UTC) or a full date-time with `Z` or an offset
|
|
187
257
|
(`2027-03-01T12:00Z`, `2027-03-01T12:00:00+02:00`) picks another. `--expires never` warns and asks first (the safe answer, Cancel, is the
|
|
@@ -260,8 +330,8 @@ A plain working clone, unrelated to any script. There is no push.
|
|
|
260
330
|
### Gateway token scopes
|
|
261
331
|
|
|
262
332
|
`kb` and `marketplace` talk to the BlueStep gateway (`gatewayUrl`, default `https://gateway.bluestep.net`;
|
|
263
|
-
change it with `b6p config set gatewayUrl <url>`) using the same stored `
|
|
264
|
-
the scopes you need:
|
|
333
|
+
change it with `b6p config set gatewayUrl <url>`) using the same stored token. `b6p auth login` gives it `mcp`, `kb:read`, `kb:push`, `registry:read` and
|
|
334
|
+
`tokens:self`; for a pasted token, mint one with the scopes you need:
|
|
265
335
|
|
|
266
336
|
| Scope | For |
|
|
267
337
|
|---|---|
|
|
@@ -453,7 +523,7 @@ any target fails by the push rules above.
|
|
|
453
523
|
|---|---|
|
|
454
524
|
| `0` | The command completed without reporting an error |
|
|
455
525
|
| `1` | The command failed, or its arguments were rejected |
|
|
456
|
-
| `130` | A prompt was interrupted with Ctrl-C |
|
|
526
|
+
| `130` | A prompt, or `b6p auth login`'s wait, was interrupted with Ctrl-C |
|
|
457
527
|
|
|
458
528
|
`--quiet` and `--json` change what is printed, never the exit code, so it is safe to gate a
|
|
459
529
|
pipeline on:
|
|
@@ -496,9 +566,10 @@ instead of stalling until the job times out.
|
|
|
496
566
|
|
|
497
567
|
## Authentication
|
|
498
568
|
|
|
499
|
-
The token from [Signing in](#signing-in) is stored in encrypted secret storage under `~/.b6p
|
|
500
|
-
|
|
501
|
-
|
|
569
|
+
The token from [Signing in](#signing-in) is stored in encrypted secret storage under `~/.b6p/`, with what the
|
|
570
|
+
sign-in said about it (gateway, token id and name, account, scopes, expiry). Any command that needs credentials
|
|
571
|
+
prompts for a token if none is stored. In CI, store one with `b6p auth set`: `b6p auth login` needs a person at a
|
|
572
|
+
browser.
|
|
502
573
|
|
|
503
574
|
For unattended use, check for credentials before running anything that might prompt:
|
|
504
575
|
|
|
@@ -519,7 +590,9 @@ Piped (or under `--yes` or `--json`), `auth set` does not ask about git; it prin
|
|
|
519
590
|
`{ "authenticated": true, "git": { "configured": false, "hint": "…" } }` (`configured` is `null` when git could
|
|
520
591
|
not be checked, and `hint` is `null` when there is nothing to say). `b6p --json auth status` carries git's state as `git`: core's
|
|
521
592
|
status (`configured`, `hosts`, `otherHelpers`, `scope`) with `error: null`, or `{ "error": "<why>" }` when
|
|
522
|
-
git cannot be checked.
|
|
593
|
+
git cannot be checked. It also carries the sign-in: `method` (`login`, `pasted` or `null`), `account`, `alias`,
|
|
594
|
+
`expiresAt`, and `signIn`, core's whole offline description (`tokenPrefix`, `gateway`, `signedInGateway`,
|
|
595
|
+
`scopes`, `refreshable`, `daysLeft`, `expired`, `renewDue`; never the token).
|
|
523
596
|
|
|
524
597
|
### Checking the token with the gateway
|
|
525
598
|
|