@bluestep-systems/b6p-cli 1.0.0 → 1.2.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 +37 -0
- package/README.md +43 -1
- package/dist/cli.js +351 -280
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,43 @@ All notable changes to `@bluestep-systems/b6p-cli` will be documented in this fi
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.2.0] — 2026-11-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Plain `git pull` and `git push` with the stored token: `b6p auth setup-git`** (b6p-core 1.3.0's
|
|
15
|
+
`core.gitCredential`, ClickUp 1k5g91bqme2). It makes `b6p` git's credential helper, as `gh auth setup-git` does,
|
|
16
|
+
for the gateway (when https) and the tenants you have pulled scripts from: an empty `helper =` and then
|
|
17
|
+
`!b6p auth git-credential` per host in the file `git config --global` writes, so no other helper sees or keeps
|
|
18
|
+
the token. It says what it wrote and where, what was set up already, and any entry of yours that still makes git
|
|
19
|
+
ask another helper; running it again changes nothing. `--remove` takes b6p's entries out and reports any reset it
|
|
20
|
+
had to leave. A plain push to a draft does not build or publish; that still takes `b6p script push`. Needs git
|
|
21
|
+
2.27 (2.42 for setup); an older git fails setup with exit `1`, saying so.
|
|
22
|
+
- **`b6p auth set` offers to set git up** once a token is stored and git is not set up (Yes is the default). Piped,
|
|
23
|
+
or under `--yes`, it never asks and prints a one-line hint instead; under `--json` it prints
|
|
24
|
+
`{ authenticated, git: { configured, hint } }`.
|
|
25
|
+
- **`b6p auth status` reports git**: set up, not set up (and which other helper git asks), or git too old. Under
|
|
26
|
+
`--json` it is the new `git` field.
|
|
27
|
+
- **`b6p kb pull` (a new clone) and `b6p script pull` print a one-line hint** to run `b6p auth setup-git` when git
|
|
28
|
+
there would not use the token. The hint never fails the pull. Known gap: after a script pull the hint reads the
|
|
29
|
+
git config in effect where the workspace is, not the draft clone's own config, since core's pull result does
|
|
30
|
+
not name the draft folder yet.
|
|
31
|
+
- `b6p auth git-credential get|store|erase`, hidden from help, is the command git runs. It is recognised by its
|
|
32
|
+
position (`b6p auth git-credential <action>`) and run before any option parsing, so `--help`, `--version` or an
|
|
33
|
+
unknown flag after it change nothing; it writes only core's answer to stdout and always exits `0`, even when a
|
|
34
|
+
cache fails to load in the background, stdout or stderr cannot be written, or Node is too old.
|
|
35
|
+
|
|
36
|
+
## [1.1.0] — 2026-11-19
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- **`b6p kb create <name>` and `b6p kb set <name>`** register a global knowledge base and change its title, live
|
|
41
|
+
branch or access (`public` or `private`), in one request each. Needs `kb:manage` to write (`kb set` reads with `kb:read`) and b6p-core 1.2.0. Making a knowledge
|
|
42
|
+
base public asks first, naming it and warning that every commit reachable from the live branch, files since
|
|
43
|
+
deleted included, becomes publicly readable (Cancel is the default); `--confirm-public` goes ahead, and the global `--yes` alone never makes it public. ClickUp 1k5g91bqhx6.
|
|
44
|
+
|
|
8
45
|
## [1.0.0] — 2026-11-17
|
|
9
46
|
|
|
10
47
|
### Fixed
|
package/README.md
CHANGED
|
@@ -77,6 +77,29 @@ 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
|
+
### Plain `git pull` and `git push`
|
|
81
|
+
|
|
82
|
+
`b6p` can be git's credential helper, the way `gh auth setup-git` is for github.com, so plain `git pull`
|
|
83
|
+
and `git push` in a knowledge-base clone or a script's `draft/` folder use the stored token without asking:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
b6p auth setup-git # set git up (b6p auth set offers to do this for you)
|
|
87
|
+
b6p auth setup-git --remove # take it out again
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
It answers git only for the gateway (when its URL is https) and for the tenants you have pulled a script
|
|
91
|
+
from, over https, and for nothing else. Setup writes, for each of those hosts, a
|
|
92
|
+
`[credential "https://<host>"]` section to the file `git config --global` writes: an empty `helper =`, so
|
|
93
|
+
no other helper (`store`, `cache`, a keychain) answers for that host or keeps a copy of the token, then
|
|
94
|
+
`helper = !b6p auth git-credential`. Your own entries are never moved or removed: if one still applies to a
|
|
95
|
+
host after b6p's (in a repository's own config, say), setup says which and what to change. Running it again
|
|
96
|
+
changes nothing; after a first script pull from another tenant, run it again to add that tenant. `b6p auth
|
|
97
|
+
status` says whether git is set up, and a `kb pull` or `script pull` prints a one-line hint when it is not.
|
|
98
|
+
|
|
99
|
+
A plain `git push` to a script's draft lands the commit but does not build or publish it: that still takes
|
|
100
|
+
`b6p script push`. git asks `b6p` by name, so `b6p` must be on the `PATH` git sees. Needs git 2.27 or later
|
|
101
|
+
(2.42 or later for setup). `b6p auth git-credential` is the command git runs; it is not for typing.
|
|
102
|
+
|
|
80
103
|
## Commands
|
|
81
104
|
|
|
82
105
|
`b6p` is organised as `b6p <subsystem> <verb>`. Each top-level name is a part of the
|
|
@@ -107,7 +130,9 @@ platform; the verbs beneath it act on that part.
|
|
|
107
130
|
| Command | Purpose |
|
|
108
131
|
|---|---|
|
|
109
132
|
| `b6p auth set` | Set or update the access token |
|
|
110
|
-
| `b6p auth status` | Report whether a token is stored (never prompts) |
|
|
133
|
+
| `b6p auth status` | Report whether a token is stored, and whether git is set up to use it (never prompts) |
|
|
134
|
+
| `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
|
+
| `b6p auth setup-git --remove` | Take b6p's entries out of your git config |
|
|
111
136
|
| `b6p auth clear` | Clear the stored token |
|
|
112
137
|
| `b6p auth token list` | List your own tokens, expired ones included, marked `(expired)` (the secret is never shown) |
|
|
113
138
|
| `b6p auth token create --alias <a> --scopes <s,…> [--expires <90d\|date\|date-time\|never>]` | Mint a token; the secret is printed once |
|
|
@@ -137,11 +162,20 @@ A new token can never outlive the token that creates it: an explicit `--expires`
|
|
|
137
162
|
| `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) |
|
|
138
163
|
| `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 |
|
|
139
164
|
| `b6p kb push [dir]` | Push a clone (default: the current folder, or the clone that contains it) to the knowledge base's live branch |
|
|
165
|
+
| `b6p kb create <name> [--title <t>] [--live-branch <b>] [--access public\|private] [--confirm-public]` | Register a global knowledge base (and its repository). Defaults: title = name, branch `main`, private |
|
|
166
|
+
| `b6p kb set <name> [--title <t>] [--live-branch <b>] [--access public\|private] [--confirm-public]` | Change a global knowledge base's title, live branch or access, in one request; at least one option is required |
|
|
140
167
|
|
|
141
168
|
`<ref>` is `<name>` for a global knowledge base or `U<number>/<name>` for a tenant's; names and the tenant match in any letter case, and the local folder uses the canonical name. Pulls never
|
|
142
169
|
overwrite local changes (the dirty paths are listed) and pushes are fast-forward only: if the knowledge
|
|
143
170
|
base moved on, pull first. Pushing needs push rights on that knowledge base as well as the `kb:push` scope.
|
|
144
171
|
|
|
172
|
+
`kb create` and `kb set` are for super users and need the `kb:manage` scope to write (`kb set` reads the knowledge base first, which needs `kb:read`, to find
|
|
173
|
+
the knowledge base). `--access public` lets anyone on the internet read the knowledge base with no sign-in, and that covers every commit reachable from the live branch, files since deleted included, so b6p asks
|
|
174
|
+
first, naming the knowledge base (Cancel is the default). `--confirm-public` goes ahead without asking, and says so; the global `--yes`
|
|
175
|
+
alone never makes a knowledge base public (it refuses). A knowledge base that
|
|
176
|
+
is already public is left alone. `--json` prints `{ knowledgeBase, changed }` (`kb set`) or `{ knowledgeBase }`
|
|
177
|
+
(`kb create`). Only global knowledge bases can be created or changed; a tenant's cannot.
|
|
178
|
+
|
|
145
179
|
### `b6p marketplace` — marketplace repositories
|
|
146
180
|
|
|
147
181
|
| Command | Purpose |
|
|
@@ -161,6 +195,7 @@ the scopes you need:
|
|
|
161
195
|
|---|---|
|
|
162
196
|
| `kb:read` | `kb list`, `kb pull` |
|
|
163
197
|
| `kb:push` | `kb push` |
|
|
198
|
+
| `kb:manage` | `kb create`, and the change in `kb set` (super users) |
|
|
164
199
|
| `registry:read` | `marketplace list`, `marketplace pull` |
|
|
165
200
|
| `tokens:self` | `auth token …` |
|
|
166
201
|
| `kb:rewrite` | rewriting a knowledge base's history (not a `b6p` command); mintable and rotatable here only if the token b6p uses holds it |
|
|
@@ -405,6 +440,13 @@ Set a token non-interactively by piping it in:
|
|
|
405
440
|
echo "$B6P_TOKEN" | b6p auth set
|
|
406
441
|
```
|
|
407
442
|
|
|
443
|
+
Piped (or under `--yes` or `--json`), `auth set` does not ask about git; it prints a one-line hint to run
|
|
444
|
+
`b6p auth setup-git` when git is not set up. Under `--json` the hint is in the result instead:
|
|
445
|
+
`{ "authenticated": true, "git": { "configured": false, "hint": "…" } }` (`configured` is `null` when git could
|
|
446
|
+
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
|
|
447
|
+
status (`configured`, `hosts`, `otherHelpers`, `scope`) with `error: null`, or `{ "error": "<why>" }` when
|
|
448
|
+
git cannot be checked.
|
|
449
|
+
|
|
408
450
|
## WebDAV URL format
|
|
409
451
|
|
|
410
452
|
```
|