@bluestep-systems/b6p-cli 1.6.0 → 1.7.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 +35 -0
- package/README.md +95 -6
- package/dist/cli.js +289 -274
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.7.0] — 2026-12-05
|
|
11
|
+
|
|
12
|
+
Requires b6p-core 1.8.1 (bundled).
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`b6p kb read <ref> [page]`** prints one knowledge-base page on stdout, untouched, and says on
|
|
17
|
+
stderr where it came from. Docs is read from the gateway with no token; the internal knowledge bases
|
|
18
|
+
(`fleet-supers`, `supers`) with the stored token. When the gateway cannot answer with the page (no token, the
|
|
19
|
+
token refused, unreachable, an unexpected answer, or a knowledge base whose pages it serves at no address), the
|
|
20
|
+
page is read from a clone of that knowledge base at its head commit: `--clone <dir>`, or `~/.bluestep/<name>` when
|
|
21
|
+
it exists. `--no-fallback` never reads a clone. A not-found is final: no clone is read after one. `--json` prints
|
|
22
|
+
the page with its source, commit and why a clone was read; a failure's body carries `reason`, `gatewayReason` and
|
|
23
|
+
`source`.
|
|
24
|
+
- **`b6p auth mcp-headers`**, for MCP clients: Claude Code's `headersHelper` and Codex's `http_headers_helper` run it
|
|
25
|
+
to get the gateway's `Authorization` header from b6p's stored token, so no `B6PT_TOKEN` environment variable is
|
|
26
|
+
needed. It prints only the header JSON, refuses a terminal, gives the token only for the gateway's own address,
|
|
27
|
+
and exits 1 with one fixed line on stderr on any failure (a closed stdout included). Root flags before or around
|
|
28
|
+
it (`--json`, `--help`, `--version`) still reach it. Core runs silent for it, so no warning of core's (a malformed
|
|
29
|
+
cache entry, say) reaches stderr. Hidden from help.
|
|
30
|
+
- **`b6p auth status --check`** asks the gateway whether it takes the stored token for BlueStep's tools: live, with
|
|
31
|
+
the `mcp` and `kb:read` scopes, and (with `tokens:self`) when it expires and whether it is refreshable. It exits 1
|
|
32
|
+
when not, saying why; `--json` adds a `check` field. The verdict, the token's row and both scopes come from one
|
|
33
|
+
read of the stored token (core's check). The suggested rotate command quotes the alias for your shell.
|
|
34
|
+
`b6p auth status` without it stays offline.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- The README no longer says the BlueStep AI tools read the token from `B6PT_TOKEN`: b6p is the one place it is kept.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- On a terminal, the spinner no longer erases the line after it has already been cleared, which wiped the last
|
|
43
|
+
line of output that had no newline (a page printed by `kb read`).
|
|
44
|
+
|
|
10
45
|
## [1.6.0] — 2026-12-04
|
|
11
46
|
|
|
12
47
|
### Added
|
package/README.md
CHANGED
|
@@ -63,9 +63,9 @@ The npm install above is unchanged and remains the recommended path wherever Nod
|
|
|
63
63
|
|
|
64
64
|
## Signing in
|
|
65
65
|
|
|
66
|
-
`b6p` signs in with your BlueStep platform access token, which starts with `b6pt_`.
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
`b6p` signs in with your BlueStep platform access token, which starts with `b6pt_`. b6p is the one
|
|
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
69
|
New Token**.
|
|
70
70
|
|
|
71
71
|
Store it with:
|
|
@@ -77,6 +77,41 @@ b6p auth set
|
|
|
77
77
|
If no token is stored, the first command you run asks for it. A `401` with a `b6pt_` token usually
|
|
78
78
|
means the token expired or its account lost access, not that it is the wrong kind of token.
|
|
79
79
|
|
|
80
|
+
### The gateway MCP gets its token from b6p
|
|
81
|
+
|
|
82
|
+
An MCP client asks b6p for the gateway's `Authorization` header instead of reading an environment variable:
|
|
83
|
+
Claude Code's `headersHelper` and Codex's `http_headers_helper` run
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
b6p auth mcp-headers
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
which prints `{"Authorization":"Bearer <token>"}` from the stored token and nothing else. BlueStep's AI Dev Kit
|
|
90
|
+
plugin sets this up; a hand-written Claude Code entry looks like:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"bluestep-gateway": {
|
|
96
|
+
"type": "http",
|
|
97
|
+
"url": "https://gateway.bluestep.net/mcp",
|
|
98
|
+
"headersHelper": "b6p auth mcp-headers"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
and for Codex, in `config.toml`: `http_headers_helper = "b6p auth mcp-headers"` under the server's table, with no
|
|
105
|
+
`bearer_token_env_var` (Codex prefers that variable to the helper). The client runs it again on reconnect and after
|
|
106
|
+
a `401`, so `b6p auth token rotate` or `b6p auth set` takes effect without a restart.
|
|
107
|
+
|
|
108
|
+
It is not for typing. It refuses a terminal (prints nothing and exits `1`), gives the token only for b6p's gateway
|
|
109
|
+
(when the client names the server, in `CLAUDE_CODE_MCP_SERVER_URL` or `--url <url>`, it must be on `gatewayUrl`'s
|
|
110
|
+
origin), never asks for anything, sends nothing anywhere, and on any failure prints one line on stderr and exits
|
|
111
|
+
`1`. Claude Code shows none of that line, so when the MCP does not connect, run `b6p auth status --check`: it asks
|
|
112
|
+
the gateway whether it takes the stored token (live, with `mcp` and `kb:read`), and says when it expires and whether
|
|
113
|
+
it is refreshable.
|
|
114
|
+
|
|
80
115
|
### Plain `git pull` and `git push`
|
|
81
116
|
|
|
82
117
|
`b6p` can be git's credential helper, the way `gh auth setup-git` is for github.com, so plain `git pull`
|
|
@@ -130,7 +165,8 @@ platform; the verbs beneath it act on that part.
|
|
|
130
165
|
| Command | Purpose |
|
|
131
166
|
|---|---|
|
|
132
167
|
| `b6p auth set` | Set or update the access token |
|
|
133
|
-
| `b6p auth status` | Report whether a token is stored, and whether git is set up to use it (never prompts) |
|
|
168
|
+
| `b6p auth status` | Report whether a token is stored, and whether git is set up to use it (never prompts, offline) |
|
|
169
|
+
| `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)) |
|
|
134
170
|
| `b6p auth setup-git` | Set git to use the token for plain `git pull` and `git push` ([details](#plain-git-pull-and-git-push)) |
|
|
135
171
|
| `b6p auth setup-git --remove` | Take b6p's entries out of your git config |
|
|
136
172
|
| `b6p auth clear` | Clear the stored token |
|
|
@@ -162,6 +198,7 @@ A new token can never outlive the token that creates it: an explicit `--expires`
|
|
|
162
198
|
|---|---|
|
|
163
199
|
| `b6p kb list [--scope global\|tenant] [--tenant U…]` | List the knowledge bases you may read, whether you may push, and each one's STATUS (`ok`, `branch-mismatch`, `repo-only`, `row-only`, `unconfirmed`, `undescribed`; a note under the table explains each one present) |
|
|
164
200
|
| `b6p kb pull <ref> [dir]` | Clone a knowledge base into a folder (default `./<name>`, or `./<tenant>-<name>` for a tenant's), or fast-forward an existing clone |
|
|
201
|
+
| `b6p kb read <ref> [page] [--clone <dir>] [--no-fallback]` | Print one page (default the README) on stdout, untouched: from the gateway for Docs and the internal knowledge bases, else from a clone ([details](#reading-a-page)) |
|
|
165
202
|
| `b6p kb push [dir]` | Push a clone (default: the current folder, or the clone that contains it) to the knowledge base's live branch |
|
|
166
203
|
| `b6p kb create <name> [--title <t>] [--live-branch <b>] [--access public\|private\|fleet-supers\|supers] [--confirm-public]` | Register a global knowledge base (and its repository). Defaults: title = name, branch `main`, private. `fleet-supers` is for BlueStep staff (fleet supers) only; `supers` is for BlueStep staff and reseller supers |
|
|
167
204
|
| `b6p kb set <name> [--title <t>] [--live-branch <b>] [--access public\|private\|fleet-supers\|supers] [--confirm-public]` | Change a global knowledge base's title, live branch or access, in one request; at least one option is required |
|
|
@@ -177,6 +214,32 @@ alone never makes a knowledge base public (it refuses). A knowledge base that
|
|
|
177
214
|
is already public is left alone. `--json` prints `{ knowledgeBase, changed }` (`kb set`) or `{ knowledgeBase }`
|
|
178
215
|
(`kb create`). `--access` is matched exactly, in lower case. `fleet-supers` and `supers` narrow access, so they need no confirmation, but the gateway accepts them only when the knowledge base is created and refuses a change to one on an existing knowledge base; b6p shows the gateway's refusal as it is. Do not set them until the gateway in that environment enforces them: an older gateway refuses them (b6p shows its message, then a hint to update the gateway) or may not enforce them. Only global knowledge bases can be created or changed; a tenant's cannot.
|
|
179
216
|
|
|
217
|
+
#### Reading a page
|
|
218
|
+
|
|
219
|
+
`b6p kb read <ref> [page]` prints the page's markdown on stdout and one line on stderr saying where it came from,
|
|
220
|
+
e.g. `global/fleet: Deployment/README.md from the gateway (commit 1a2b3c4)`. `page` is a path in the knowledge base:
|
|
221
|
+
`README.md`, `Deployment` (that is `Deployment.md`, or `Deployment/README.md` when it is a folder),
|
|
222
|
+
`Deployment/` (the folder's README) or `Deployment/Ring rollout.md`; no leading `/`, `..` or backslash.
|
|
223
|
+
|
|
224
|
+
- **Docs** (`docs`) is read from `/support/docs/<page>.md` with no token at all, as the site is.
|
|
225
|
+
- **Internal knowledge bases** (`fleet-supers` and `supers` access) are read from `/console/docs/<name>/<page>.md`
|
|
226
|
+
with the stored token (`kb:read`).
|
|
227
|
+
- **Any other** knowledge base (another public one, a private or a tenant one): the gateway serves its pages at no
|
|
228
|
+
address yet, so only a clone can be read.
|
|
229
|
+
|
|
230
|
+
When the gateway cannot answer with the page (no token, the token refused, unreachable, an answer that is not the
|
|
231
|
+
page, or no address), the page is read from a clone instead: `--clone <dir>`, or `~/.bluestep/<name>` when that
|
|
232
|
+
folder exists. The clone must be a clone of that knowledge base; the page is read at its head commit (local edits
|
|
233
|
+
are not seen, a symbolic link is never followed) and nothing is fetched, so keep it fresh with `b6p kb pull`.
|
|
234
|
+
`--no-fallback` never reads a clone. **A not-found is final**: the gateway answers 404 for a page you may not see
|
|
235
|
+
too, so a clone is never read after one, and a knowledge base the listing does not show is not found either.
|
|
236
|
+
|
|
237
|
+
`--json` prints `{ ref, page, source, commit, text, clone, fallbackReason }`: `source` is `gateway` or `clone`,
|
|
238
|
+
`fallbackReason` is why the clone was read (`no-token`, `refused`, `unavailable`, `unexpected`, `no-route`) or
|
|
239
|
+
`null`. A failure exits `1`; under `--json` its body has `error`, `errors`, `reason` (`not-found`, `no-clone`,
|
|
240
|
+
`no-fallback`, `not-a-clone`, `clone-mismatch`, `clone-refused`, `bad-page`), `gatewayReason` (why the gateway did
|
|
241
|
+
not answer, or `null`) and `source` (for `not-found`: `gateway` or `clone`).
|
|
242
|
+
|
|
180
243
|
### `b6p marketplace` — marketplace repositories
|
|
181
244
|
|
|
182
245
|
| Command | Purpose |
|
|
@@ -202,7 +265,8 @@ the scopes you need:
|
|
|
202
265
|
|
|
203
266
|
| Scope | For |
|
|
204
267
|
|---|---|
|
|
205
|
-
| `kb:read` | `kb list`, `kb pull` |
|
|
268
|
+
| `kb:read` | `kb list`, `kb pull`, `kb read` (all but Docs, which needs no token) |
|
|
269
|
+
| `mcp` | the gateway MCP, through `auth mcp-headers` (not used by b6p's own commands; `auth status --check` checks it) |
|
|
206
270
|
| `kb:push` | `kb push` |
|
|
207
271
|
| `kb:manage` | `kb create`, and the change in `kb set` (super users) |
|
|
208
272
|
| `registry:read` | `marketplace list`, `marketplace get`, `marketplace pull` |
|
|
@@ -410,7 +474,7 @@ $ b6p --json script deploy missing.json
|
|
|
410
474
|
```
|
|
411
475
|
|
|
412
476
|
Note that a command reporting a *value* has still succeeded — `b6p auth status` exits `0` whether
|
|
413
|
-
or not a token is stored. Branch on its output, not its exit code:
|
|
477
|
+
or not a token is stored (`b6p auth status --check`, a check, exits `1` when it fails). Branch on its output, not its exit code:
|
|
414
478
|
|
|
415
479
|
```bash
|
|
416
480
|
b6p --json auth status | jq -e .authenticated >/dev/null
|
|
@@ -457,6 +521,31 @@ not be checked, and `hint` is `null` when there is nothing to say). `b6p --json
|
|
|
457
521
|
status (`configured`, `hosts`, `otherHelpers`, `scope`) with `error: null`, or `{ "error": "<why>" }` when
|
|
458
522
|
git cannot be checked.
|
|
459
523
|
|
|
524
|
+
### Checking the token with the gateway
|
|
525
|
+
|
|
526
|
+
`b6p auth status` is offline and only says whether a well-formed token is stored. `b6p auth status --check` also
|
|
527
|
+
asks the gateway (core's MCP check, on one read of the stored token): whether
|
|
528
|
+
the token is live, whether `/mcp` takes it (`mcp`), whether it holds `kb:read`, and, with `tokens:self`, its alias,
|
|
529
|
+
expiry and whether it is refreshable. It exits `0` when the token works for BlueStep's tools and `1` when it does
|
|
530
|
+
not, saying why and what to do. `--json` adds a `check` field:
|
|
531
|
+
|
|
532
|
+
```json
|
|
533
|
+
{
|
|
534
|
+
"ok": true,
|
|
535
|
+
"reason": null,
|
|
536
|
+
"missingScope": null,
|
|
537
|
+
"scopes": { "mcp": true, "kb:read": true },
|
|
538
|
+
"token": { "alias": "laptop", "expiresAt": "2027-03-01T00:00:00Z", "refreshable": true },
|
|
539
|
+
"status": 200,
|
|
540
|
+
"error": null
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
`reason` is `token-missing`, `token-malformed` (nothing is sent for either), `token-invalid` (expired or revoked;
|
|
545
|
+
the gateway does not say which), `scope-missing` (`missingScope` names it), `not-permitted` or `unreachable` (the
|
|
546
|
+
gateway could not give a verdict; `error` says what to do). A scope is `null` when it could not be told, and
|
|
547
|
+
`token` is `null` without `tokens:self`.
|
|
548
|
+
|
|
460
549
|
## WebDAV URL format
|
|
461
550
|
|
|
462
551
|
```
|