@theholocron/cli 5.0.0-alpha.177 → 5.0.0-alpha.178
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/README.md +52 -4
- package/dist/cli.mjs +576 -76
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -38,6 +38,51 @@ $ holocron
|
|
|
38
38
|
? Target Node.js major version: › 24
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
For a command that declares options (so far: `package publish` — more are
|
|
42
|
+
rolled out one command group at a time), it also offers those: any required
|
|
43
|
+
option is prompted like a positional, and everything else goes through one
|
|
44
|
+
"Set any options?" checkbox, prompting only what you picked:
|
|
45
|
+
|
|
46
|
+
```console
|
|
47
|
+
? Set any options? (space to select, enter to skip) › ◉ npm dist-tag ◯ One-time password (2FA)
|
|
48
|
+
? npm dist-tag (blank = latest): › beta
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`package publish` specifically has three workflows that don't mix — a
|
|
52
|
+
steady-state publish, a one-shot `--initial` bootstrap, and a `--sync-trust`
|
|
53
|
+
maintenance run — so it asks which one first, then only offers that
|
|
54
|
+
workflow's own options; nothing from a different workflow is ever shown:
|
|
55
|
+
|
|
56
|
+
```console
|
|
57
|
+
? What would you like to do? › Initial publish (--initial)
|
|
58
|
+
? Set any options? (space to select, enter to skip) › ◉ One-time password (2FA)
|
|
59
|
+
...dry-run output...
|
|
60
|
+
? Dry run complete — proceed with the real run? › yes
|
|
61
|
+
? One-time password (2FA), if npm requires it for this publish: › ***
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Each workflow's label ends with its real flag in parentheses when it has
|
|
65
|
+
one, and a longer caveat ("use only for a package's very first publish")
|
|
66
|
+
shows as helper text under the highlighted choice rather than bloating the
|
|
67
|
+
label itself.
|
|
68
|
+
|
|
69
|
+
A secret option (`--otp`) is masked as you type and delivered to the spawned
|
|
70
|
+
command through its environment, never its argv — `ps` and shell history
|
|
71
|
+
both expose a child's argv, never its env. A time-sensitive one like `--otp`
|
|
72
|
+
is checked off early but not actually typed until right before the real run
|
|
73
|
+
— after the dry-run preview and the "proceed?" question, never before —
|
|
74
|
+
since a dry run never checks it anyway and a code typed any earlier risks
|
|
75
|
+
going stale while something else is still being answered.
|
|
76
|
+
|
|
77
|
+
Whether an option is _checkbox-optional vs. always included_ and _collected
|
|
78
|
+
upfront vs. collected last_ are independent choices. `package publish`'s
|
|
79
|
+
`--otp` is always collected last, but whether it's checkbox-optional depends
|
|
80
|
+
on `HOLOCRON_NPM_ENFORCE_2FA`: unset (the default), it's opt-in like any other
|
|
81
|
+
checkbox pick; set in your own shell profile (never checked into the repo),
|
|
82
|
+
it's always included — for an operator whose own npm account enforces 2FA
|
|
83
|
+
on every publish, so the box doesn't need re-checking every single run.
|
|
84
|
+
Setting it has no effect on anyone else publishing from the same repo.
|
|
85
|
+
|
|
41
86
|
The picked command spawns as a normal `holocron <command> …` invocation —
|
|
42
87
|
`--token`, `--org`, `--cwd`, and `--dry-run` on the original invocation carry
|
|
43
88
|
through. A non-interactive shell (CI, a script, a pipe) gets the old
|
|
@@ -651,10 +696,13 @@ the local override exists to exempt.
|
|
|
651
696
|
`monitoring check`, `secrets set`, `secrets sync`, `package publish`,
|
|
652
697
|
`package bump-versions`, `sync github`, `repo upgrade node`,
|
|
653
698
|
`repo upgrade deps`, `new plugin`, `auth`
|
|
654
|
-
- `src/interactive-menu
|
|
655
|
-
`
|
|
656
|
-
|
|
657
|
-
`
|
|
699
|
+
- `src/interactive-menu/` — the interactive fallback: `command-registry`
|
|
700
|
+
(`COMMAND_REGISTRY`, each entry's `positionals`/`options`), `launch-menu`
|
|
701
|
+
(Layers 1–2, picks + spawns a fresh `holocron <command>`), `child-argv`
|
|
702
|
+
(builds the spawned argv + secret env), `menu-items`, `run-menu-entries`.
|
|
703
|
+
The generic prompting pieces it calls — `promptForPositionals`,
|
|
704
|
+
`promptForOptions` (Layer 3) — live in `src/ui/`, which has no knowledge
|
|
705
|
+
of commands.
|
|
658
706
|
|
|
659
707
|
## Status
|
|
660
708
|
|