kylon-cli 0.1.0-next.7 → 0.1.0-next.71
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 +60 -148
- package/dist/kylon-bundle.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,36 +6,31 @@ Requires Node.js 22 or newer.
|
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
The
|
|
10
|
-
|
|
9
|
+
The CLI is published to npm as
|
|
10
|
+
[`kylon-cli`](https://www.npmjs.com/package/kylon-cli). The Web UI
|
|
11
11
|
generates two separate commands — an **install** step and a **run**
|
|
12
12
|
step — each with its own Copy button. Operators paste the install
|
|
13
13
|
once per host (and any time they want to upgrade) and the run
|
|
14
|
-
whenever they want to start the daemon.
|
|
15
|
-
[Planned: npm install](#planned-npm-install) below) but not wired yet.
|
|
14
|
+
whenever they want to start the daemon.
|
|
16
15
|
|
|
17
16
|
### Step 1 — Install kylon (once per host, re-paste to upgrade)
|
|
18
17
|
|
|
19
18
|
```bash
|
|
20
|
-
|
|
21
|
-
&& chmod +x /tmp/kylon.new \
|
|
22
|
-
&& sudo mv /tmp/kylon.new /usr/local/bin/kylon
|
|
19
|
+
npm install -g kylon-cli@latest
|
|
23
20
|
```
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
Installs the CLI globally so the `kylon` binary lands on PATH — the
|
|
23
|
+
gateway daemon's child `kylon workspace …` calls (issued by the
|
|
24
|
+
provider subprocess) resolve it there. Re-run to upgrade to whatever
|
|
25
|
+
the dist-tag now points to. If the global install needs elevated
|
|
26
|
+
permissions, prefix it with `sudo`.
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`kylon-vX.Y.Z.mjs` from that release's page — every release
|
|
34
|
-
publishes both the stable-name `kylon.mjs` and the versioned copy.
|
|
28
|
+
The dist-tag tracks the environment: production installs `@latest`,
|
|
29
|
+
dev installs `@next` (newest prerelease). To pin a specific build,
|
|
30
|
+
install `kylon-cli@X.Y.Z`.
|
|
35
31
|
|
|
36
|
-
Requirements: Node.js 22
|
|
37
|
-
(
|
|
38
|
-
should use WSL).
|
|
32
|
+
Requirements: Node.js 22+ (npm ships with Node). Linux / macOS only
|
|
33
|
+
(Windows operators should use WSL).
|
|
39
34
|
|
|
40
35
|
### Step 2 — Start the gateway daemon
|
|
41
36
|
|
|
@@ -65,18 +60,18 @@ pnpm --filter kylon-cli build
|
|
|
65
60
|
See [Development → Exposing `kylon` to provider subprocesses](#exposing-kylon-to-provider-subprocesses)
|
|
66
61
|
for the debugger-friendly tsx-based dev loop.
|
|
67
62
|
|
|
68
|
-
###
|
|
63
|
+
### Release channels
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
`
|
|
78
|
-
ad-hoc
|
|
79
|
-
|
|
65
|
+
npm dist-tags are the version pointer — there is no server-side version
|
|
66
|
+
policy. Every merge to `main` publishes a prerelease to the `next` tag
|
|
67
|
+
(`.github/workflows/cli-publish.yml`); cutting a `kylon-cli-vX.Y.Z`
|
|
68
|
+
release tag publishes a stable to `latest`. dev installs `@next` and prd
|
|
69
|
+
installs `@latest`, so each environment tracks its own train.
|
|
70
|
+
|
|
71
|
+
Cutting a stable is a manual, when-ready step: tag a validated build
|
|
72
|
+
`kylon-cli-vX.Y.Z` and push the tag; CI publishes it to `latest`. Don't
|
|
73
|
+
`npm publish` ad-hoc — releases go through the CI workflow so the OIDC
|
|
74
|
+
publish path is exercised end-to-end.
|
|
80
75
|
|
|
81
76
|
## Usage
|
|
82
77
|
|
|
@@ -291,9 +286,9 @@ shim. The shim execs `node --import tsx <src>`, so:
|
|
|
291
286
|
- On SIGINT/SIGTERM the tmpdir is wiped.
|
|
292
287
|
|
|
293
288
|
This flag is **only compiled into local (non-minified) builds**. The
|
|
294
|
-
npm package
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
npm package and any `bundle:release` output reject `--dev-cli-shim` as
|
|
290
|
+
an unknown argument and omit it from `--help`, so it can never
|
|
291
|
+
accidentally ship.
|
|
297
292
|
|
|
298
293
|
### Debugging both the daemon and `kylon workspace` calls
|
|
299
294
|
|
|
@@ -339,7 +334,7 @@ The release artifact is a single-file ESM bundle produced by
|
|
|
339
334
|
|---|---|---|---|
|
|
340
335
|
| `pnpm --filter kylon-cli bundle` | `dist/kylon-bundle.mjs` | _(none)_ | debugging the bundled shape while keeping readable names — not shipped |
|
|
341
336
|
| `pnpm --filter kylon-cli bundle:minify` | `dist/kylon-bundle.mjs` | `--minify` | reproducing the pre-obfuscation size and behavior for a bisect |
|
|
342
|
-
| `pnpm --filter kylon-cli bundle:release` | `dist/kylon-bundle.mjs` | `--minify --obfuscate` | what ships on npm
|
|
337
|
+
| `pnpm --filter kylon-cli bundle:release` | `dist/kylon-bundle.mjs` | `--minify --obfuscate` | what ships on npm |
|
|
343
338
|
|
|
344
339
|
The `bundle:release` path runs esbuild with `--minify`, then passes the
|
|
345
340
|
output through `javascript-obfuscator`. It's also what the `prepack` hook
|
|
@@ -423,12 +418,11 @@ API server is the security boundary.
|
|
|
423
418
|
|
|
424
419
|
## Release
|
|
425
420
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
`
|
|
430
|
-
|
|
431
|
-
See [Planned: npm publish](#planned-npm-publish) below.
|
|
421
|
+
The CLI ships via **npm dist-tags** — there is no server-side version policy.
|
|
422
|
+
`cli-verify.yml` validates on PRs and pushes; `cli-publish.yml` publishes via
|
|
423
|
+
OIDC (no token): a prerelease to the `next` tag on every merge to `main`, and a
|
|
424
|
+
stable to `latest` when a `kylon-cli-vX.Y.Z` tag is pushed. dev installs
|
|
425
|
+
`@next`, prd installs `@latest`.
|
|
432
426
|
|
|
433
427
|
### Versioning
|
|
434
428
|
|
|
@@ -440,121 +434,39 @@ Use explicit semver in `packages/cli/package.json`:
|
|
|
440
434
|
| minor (`0.1.x → 0.2.0`) | backward-compatible capability (new command, new flag) |
|
|
441
435
|
| major (`0.x.x → 1.0.0`) | breaking change to CLI contract or runtime behavior |
|
|
442
436
|
|
|
443
|
-
|
|
444
|
-
`cli
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
semver and let the publish workflow own version selection.
|
|
437
|
+
Prerelease builds are versioned `0.1.0-next.<run>` automatically by
|
|
438
|
+
`cli-publish.yml`; a stable release is whatever you tag — bump
|
|
439
|
+
`packages/cli/package.json` to the target semver, then push the matching
|
|
440
|
+
`kylon-cli-vX.Y.Z` tag.
|
|
448
441
|
|
|
449
|
-
###
|
|
442
|
+
### Publishing
|
|
450
443
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
`
|
|
444
|
+
- **Prerelease (automatic):** every merge to `main` touching the CLI publishes
|
|
445
|
+
`0.1.0-next.<run>` to the `next` tag via `cli-publish.yml` (OIDC, no
|
|
446
|
+
`NPM_TOKEN`). dev tracks this tag, so dev always dogfoods the newest build.
|
|
447
|
+
- **Stable (manual, when ready):** bump `packages/cli/package.json` to the
|
|
448
|
+
target version, merge, then tag the commit on `main`:
|
|
454
449
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
4. Creates a GitHub Release tagged `cli/v0.0.${run_number}` with both
|
|
462
|
-
`.mjs` files attached.
|
|
450
|
+
```bash
|
|
451
|
+
git pull
|
|
452
|
+
git tag kylon-cli-v0.1.1
|
|
453
|
+
git push origin kylon-cli-v0.1.1 # cli-publish.yml publishes it to `latest`
|
|
454
|
+
npm view kylon-cli dist-tags # verify
|
|
455
|
+
```
|
|
463
456
|
|
|
464
|
-
|
|
465
|
-
|
|
457
|
+
Do not `npm publish` ad-hoc — releases go through the workflow so the OIDC
|
|
458
|
+
provenance path is exercised end to end.
|
|
466
459
|
|
|
467
|
-
|
|
468
|
-
gh release download --repo fre-so/p2 --pattern 'kylon.mjs' --output /tmp/kylon
|
|
469
|
-
chmod +x /tmp/kylon
|
|
470
|
-
sudo mv /tmp/kylon /usr/local/bin/kylon
|
|
471
|
-
```
|
|
460
|
+
### Rollback
|
|
472
461
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
No npm token required; the workflow only needs `contents: write`.
|
|
477
|
-
|
|
478
|
-
### Rollback (GitHub channel)
|
|
479
|
-
|
|
480
|
-
If the most recent push produced a broken CLI:
|
|
481
|
-
|
|
482
|
-
1. Identify the last known good release under
|
|
483
|
-
<https://github.com/fre-so/p2/releases>.
|
|
484
|
-
2. Manually re-upload that release's bundle under the name
|
|
485
|
-
`kylon.mjs` on the most recent release — that's what the Web UI's
|
|
486
|
-
stable URL resolves against. (Alternatively, revert the bad commit
|
|
487
|
-
and let `release-cli.yml` cut a new release.)
|
|
488
|
-
3. Hosts with persistent installs re-run `curl -fsSL … -o
|
|
489
|
-
/usr/local/bin/kylon` to pull the rolled-back bundle.
|
|
490
|
-
|
|
491
|
-
There is no equivalent of `npm deprecate` on GitHub Releases, so a
|
|
492
|
-
broken bundle is "fixed" only by publishing a newer one.
|
|
493
|
-
|
|
494
|
-
### Planned: npm publish
|
|
495
|
-
|
|
496
|
-
This package is already wired for `npm publish` (metadata, `files`,
|
|
497
|
-
`prepack`, `publishConfig.access: public`). The only things missing
|
|
498
|
-
are the publish CI workflow and the owning npm account. The plan:
|
|
499
|
-
|
|
500
|
-
1. Someone claims `kylon-cli` on npm (the name is currently 404).
|
|
501
|
-
2. A granular publish token (Read + Write on `kylon-cli`) is stored
|
|
502
|
-
as the `NPM_TOKEN` GitHub Actions secret on `fre-so/p2`.
|
|
503
|
-
3. Split the release automation:
|
|
504
|
-
- **`cli-verify.yml`** — runs on PRs and pushes touching
|
|
505
|
-
`packages/cli/**`. Runs typecheck, lint, test, `bundle:release`,
|
|
506
|
-
and `npm pack`. Does not publish.
|
|
507
|
-
- **`cli-publish.yml`** — runs on push of tag `cli/vX.Y.Z`.
|
|
508
|
-
Verifies the tag matches `packages/cli/package.json#version`,
|
|
509
|
-
then `pnpm --filter kylon-cli publish --access public
|
|
510
|
-
--no-git-checks` with
|
|
511
|
-
`NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}`.
|
|
512
|
-
4. The API exposes `recommendedCliVersion`; the Web UI flips from
|
|
513
|
-
the `curl` shape above to `npx -y kylon-cli@<recommended> gateway
|
|
514
|
-
run …`.
|
|
515
|
-
|
|
516
|
-
Until (2) + (3) land, do **not** `npm publish` ad-hoc — the first
|
|
517
|
-
live release should come out through the paired CI workflow so the
|
|
518
|
-
token path is exercised end-to-end. Once the workflow exists, the
|
|
519
|
-
release ritual becomes:
|
|
462
|
+
npm publishes are immutable; roll back by re-pointing the tag, not by
|
|
463
|
+
unpublishing:
|
|
520
464
|
|
|
521
465
|
```bash
|
|
522
|
-
#
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
# 2. Merge to main via PR, verify CI is green
|
|
526
|
-
|
|
527
|
-
# 3. Tag the commit on main
|
|
528
|
-
git pull
|
|
529
|
-
git tag cli/v0.1.1
|
|
530
|
-
git push origin cli/v0.1.1
|
|
531
|
-
|
|
532
|
-
# 4. GitHub Actions publishes; verify
|
|
533
|
-
npm view kylon-cli@0.1.1 dist-tags
|
|
466
|
+
npm dist-tag add kylon-cli@<last-good> latest # move the channel back
|
|
467
|
+
npm deprecate kylon-cli@<bad> "Broken release — use <last-good>."
|
|
534
468
|
```
|
|
535
469
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
until they restart). If the pushed version is actively broken, also
|
|
540
|
-
`npm deprecate kylon-cli@<bad> "…"` so operators that ignore the
|
|
541
|
-
recommendation see a warning. Do not `npm unpublish`.
|
|
542
|
-
|
|
543
|
-
### Pre-release channel (npm-era, also planned)
|
|
544
|
-
|
|
545
|
-
Once npm is live, risky changes can go out under a `next` dist-tag so
|
|
546
|
-
the Web UI's recommended version is untouched:
|
|
547
|
-
|
|
548
|
-
```bash
|
|
549
|
-
# 1. Bump to a prerelease version
|
|
550
|
-
pnpm --filter kylon-cli version 0.2.0-next.0
|
|
551
|
-
|
|
552
|
-
# 2. Publish under the `next` dist-tag
|
|
553
|
-
cd packages/cli && pnpm publish --tag next --access public --no-git-checks
|
|
554
|
-
|
|
555
|
-
# 3. Operators can opt in explicitly
|
|
556
|
-
npx -y kylon-cli@next gateway run …
|
|
557
|
-
|
|
558
|
-
# 4. Promote to `latest` once validated
|
|
559
|
-
npm dist-tag add kylon-cli@0.2.0-next.0 latest
|
|
560
|
-
```
|
|
470
|
+
Operators on `@latest` pick up the re-pointed version the next time they
|
|
471
|
+
`npm install -g kylon-cli@latest`; in-flight daemons keep their current CLI
|
|
472
|
+
until they restart. Do not `npm unpublish`.
|