@theholocron/cli 5.0.0-alpha.238 → 5.0.0-alpha.239
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/dist/cli.mjs +330 -267
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { homedir, hostname, tmpdir, userInfo } from "node:os";
|
|
5
|
-
import path, { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
6
4
|
import { LOG_LEVELS, NoopAnalyticsSink, NoopErrorSink, redactObject } from "@theholocron/observability/core";
|
|
7
5
|
import yargs from "yargs";
|
|
8
6
|
import { hideBin } from "yargs/helpers";
|
|
@@ -16,12 +14,14 @@ import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
|
16
14
|
import ora from "ora";
|
|
17
15
|
import { checkbox, confirm, input, password, select } from "@inquirer/prompts";
|
|
18
16
|
import { createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
|
|
17
|
+
import { homedir, hostname, tmpdir, userInfo } from "node:os";
|
|
19
18
|
import { PostHogSink } from "@theholocron/observability/analytics";
|
|
20
19
|
import { SentrySink } from "@theholocron/observability/errors";
|
|
21
20
|
import { KNOWN_WORKFLOWS, createAlexignore, createAlexrc, createAstromech, createCommitMsg, createDependabot, createDevmoji, createEditorconfig, createEditorconfigChecker, createHeader, createLabeler, createPreCommit, createPrePush, createPrepareCommitMsg, createYamlignore, createYamllint, defaultListDirs, defaultPaths, defaultReadJson, deployOnRelease, extractPreviewConfig, readWorkspacePackages, reusableTemplates, workspacePackages } from "@theholocron/astromech";
|
|
22
21
|
import { loadTasksConfig } from "@theholocron/astromech/config";
|
|
23
22
|
import { pathToFileURL } from "node:url";
|
|
24
23
|
import { errorMessage } from "@theholocron/misc-utils";
|
|
24
|
+
import path, { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
25
25
|
import { ConfigFileError, loadConfigFile } from "@theholocron/datapad";
|
|
26
26
|
import { readGitRemote, updateGitignore } from "@theholocron/git-utils";
|
|
27
27
|
import { listWorkspacePackagesSync, readPackageJson, readPackageJsonSync } from "@theholocron/pkg-utils";
|
|
@@ -1329,8 +1329,276 @@ function secretEnv(resolved) {
|
|
|
1329
1329
|
return out;
|
|
1330
1330
|
}
|
|
1331
1331
|
//#endregion
|
|
1332
|
-
//#region src/
|
|
1332
|
+
//#region src/commands/auth/auth-check.entry.ts
|
|
1333
|
+
const authCheckEntry = {
|
|
1334
|
+
name: "auth check",
|
|
1335
|
+
description: "Re-verify a stored bootstrap token",
|
|
1336
|
+
positionals: [{
|
|
1337
|
+
key: "provider",
|
|
1338
|
+
message: "Provider:",
|
|
1339
|
+
type: "select",
|
|
1340
|
+
choices: listStoredProviders
|
|
1341
|
+
}]
|
|
1342
|
+
};
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region src/commands/auth/auth-list.entry.ts
|
|
1345
|
+
const authListEntry = {
|
|
1346
|
+
name: "auth list",
|
|
1347
|
+
description: "List every provider with a stored bootstrap token",
|
|
1348
|
+
positionals: []
|
|
1349
|
+
};
|
|
1350
|
+
//#endregion
|
|
1351
|
+
//#region src/commands/auth/auth-set.entry.ts
|
|
1352
|
+
const authSetEntry = {
|
|
1353
|
+
name: "auth set",
|
|
1354
|
+
description: "Verify + store a bootstrap token for a provider",
|
|
1355
|
+
positionals: [{
|
|
1356
|
+
key: "provider",
|
|
1357
|
+
message: "Provider name:",
|
|
1358
|
+
type: "input"
|
|
1359
|
+
}]
|
|
1360
|
+
};
|
|
1361
|
+
//#endregion
|
|
1362
|
+
//#region src/commands/auth/auth-unset.entry.ts
|
|
1363
|
+
const authUnsetEntry = {
|
|
1364
|
+
name: "auth unset",
|
|
1365
|
+
description: "Remove a stored bootstrap token",
|
|
1366
|
+
positionals: [{
|
|
1367
|
+
key: "provider",
|
|
1368
|
+
message: "Provider:",
|
|
1369
|
+
type: "select",
|
|
1370
|
+
choices: listStoredProviders
|
|
1371
|
+
}]
|
|
1372
|
+
};
|
|
1373
|
+
//#endregion
|
|
1374
|
+
//#region src/interactive-menu/command-registry/validators.ts
|
|
1333
1375
|
const numeric = (value) => /^\d+$/.test(value) ? true : "enter a number";
|
|
1376
|
+
//#endregion
|
|
1377
|
+
//#region src/commands/cleanup-preview/cleanup-preview.entry.ts
|
|
1378
|
+
const cleanupPreviewEntry = {
|
|
1379
|
+
name: "deploy cleanup-preview",
|
|
1380
|
+
description: "List and delete Cloudflare Pages preview deployments for a GitHub PR",
|
|
1381
|
+
positionals: [{
|
|
1382
|
+
key: "pr",
|
|
1383
|
+
message: "PR number:",
|
|
1384
|
+
type: "input",
|
|
1385
|
+
validate: numeric
|
|
1386
|
+
}],
|
|
1387
|
+
supportsDryRun: true
|
|
1388
|
+
};
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/commands/clone/clone.entry.ts
|
|
1391
|
+
const cloneEntry = {
|
|
1392
|
+
name: "clone",
|
|
1393
|
+
description: "Clone a single repo (org/repo) or every repo in an org (org)",
|
|
1394
|
+
positionals: [{
|
|
1395
|
+
key: "target",
|
|
1396
|
+
message: "org/repo to clone (or a bare org to clone every repo in it):",
|
|
1397
|
+
type: "input",
|
|
1398
|
+
validate: (v) => v.trim().length > 0 || "org/repo or org is required"
|
|
1399
|
+
}],
|
|
1400
|
+
supportsDryRun: true
|
|
1401
|
+
};
|
|
1402
|
+
//#endregion
|
|
1403
|
+
//#region src/commands/config-show/config-show.entry.ts
|
|
1404
|
+
const configShowEntry = {
|
|
1405
|
+
name: "config show",
|
|
1406
|
+
description: "Print the resolved holocron config",
|
|
1407
|
+
positionals: []
|
|
1408
|
+
};
|
|
1409
|
+
//#endregion
|
|
1410
|
+
//#region src/commands/deploy/deploy.entry.ts
|
|
1411
|
+
const deployEntry = {
|
|
1412
|
+
name: "deploy",
|
|
1413
|
+
description: "Trigger a deployment via the configured `deployment` capability",
|
|
1414
|
+
positionals: [{
|
|
1415
|
+
key: "branch",
|
|
1416
|
+
message: "Branch to deploy:",
|
|
1417
|
+
type: "input"
|
|
1418
|
+
}],
|
|
1419
|
+
supportsDryRun: true
|
|
1420
|
+
};
|
|
1421
|
+
//#endregion
|
|
1422
|
+
//#region src/commands/deploy/deploy-on-release.entry.ts
|
|
1423
|
+
const deployOnReleaseEntry = {
|
|
1424
|
+
name: "deploy on-release",
|
|
1425
|
+
description: "Deploy every workspace package whose delivery.deploy task is `on: release`",
|
|
1426
|
+
positionals: [],
|
|
1427
|
+
supportsDryRun: true
|
|
1428
|
+
};
|
|
1429
|
+
//#endregion
|
|
1430
|
+
//#region src/commands/doctor/doctor.entry.ts
|
|
1431
|
+
const doctorEntry = {
|
|
1432
|
+
name: "doctor",
|
|
1433
|
+
description: "Load the config and run a smoke check against every provider",
|
|
1434
|
+
positionals: [],
|
|
1435
|
+
supportsDryRun: true
|
|
1436
|
+
};
|
|
1437
|
+
//#endregion
|
|
1438
|
+
//#region src/commands/doctor-notifications/doctor-notifications.entry.ts
|
|
1439
|
+
const doctorNotificationsEntry = {
|
|
1440
|
+
name: "doctor notifications",
|
|
1441
|
+
description: "Check the layout against the server and the secrets store, step by step (a full run leaves one test post in the test channel; --built-only posts nothing unless --deliver)",
|
|
1442
|
+
positionals: [],
|
|
1443
|
+
options: [{
|
|
1444
|
+
key: "deliver",
|
|
1445
|
+
flag: "--deliver",
|
|
1446
|
+
type: "confirm",
|
|
1447
|
+
default: false,
|
|
1448
|
+
message: "Post a test message through every channel's webhook (each removes itself)?"
|
|
1449
|
+
}],
|
|
1450
|
+
supportsDryRun: false
|
|
1451
|
+
};
|
|
1452
|
+
//#endregion
|
|
1453
|
+
//#region src/commands/monitoring-check/monitoring-check.entry.ts
|
|
1454
|
+
const monitoringCheckEntry = {
|
|
1455
|
+
name: "monitoring check",
|
|
1456
|
+
description: "Run every configured `monitoring` check against a given URL instead of its own configured url",
|
|
1457
|
+
positionals: [{
|
|
1458
|
+
key: "url",
|
|
1459
|
+
message: "URL to test against:",
|
|
1460
|
+
type: "input"
|
|
1461
|
+
}],
|
|
1462
|
+
supportsDryRun: false
|
|
1463
|
+
};
|
|
1464
|
+
//#endregion
|
|
1465
|
+
//#region src/commands/new/new-repo.entry.ts
|
|
1466
|
+
const newRepoEntry = {
|
|
1467
|
+
name: "new repo",
|
|
1468
|
+
description: "Scaffold a new repo from a GitHub template (e.g. cli, react, nextjs, node, monorepo, base)",
|
|
1469
|
+
positionals: [],
|
|
1470
|
+
supportsDryRun: true
|
|
1471
|
+
};
|
|
1472
|
+
//#endregion
|
|
1473
|
+
//#region src/commands/notifications-channel-add/notifications-channel-add.entry.ts
|
|
1474
|
+
const notificationsChannelAddEntry = {
|
|
1475
|
+
name: "notifications channel add",
|
|
1476
|
+
description: "Create a notification channel, optionally with a webhook whose URL is stored as a secret",
|
|
1477
|
+
positionals: [{
|
|
1478
|
+
key: "name",
|
|
1479
|
+
message: "Channel name:",
|
|
1480
|
+
type: "input"
|
|
1481
|
+
}],
|
|
1482
|
+
supportsDryRun: true
|
|
1483
|
+
};
|
|
1484
|
+
//#endregion
|
|
1485
|
+
//#region src/commands/notifications-create-server/notifications-create-server.entry.ts
|
|
1486
|
+
const notificationsCreateServerEntry = {
|
|
1487
|
+
name: "notifications create-server",
|
|
1488
|
+
description: "Create the server the layout describes, apply it, invite its owner and hand it over",
|
|
1489
|
+
positionals: [],
|
|
1490
|
+
options: [
|
|
1491
|
+
{
|
|
1492
|
+
key: "name",
|
|
1493
|
+
flag: "--name",
|
|
1494
|
+
type: "input",
|
|
1495
|
+
message: "What the new server is called (blank when resuming):"
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
key: "owner",
|
|
1499
|
+
flag: "--owner",
|
|
1500
|
+
type: "input",
|
|
1501
|
+
required: true,
|
|
1502
|
+
message: "Member id of the person who will own it:"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
key: "force",
|
|
1506
|
+
flag: "--force",
|
|
1507
|
+
type: "confirm",
|
|
1508
|
+
default: false,
|
|
1509
|
+
message: "The config already names a server: create another and replace its id?"
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
key: "resume",
|
|
1513
|
+
flag: "--resume",
|
|
1514
|
+
type: "confirm",
|
|
1515
|
+
default: false,
|
|
1516
|
+
message: "Finish an earlier run (the server exists): invite the owner and hand it over?"
|
|
1517
|
+
}
|
|
1518
|
+
],
|
|
1519
|
+
supportsDryRun: true
|
|
1520
|
+
};
|
|
1521
|
+
//#endregion
|
|
1522
|
+
//#region src/commands/notifications-link/notifications-link.entry.ts
|
|
1523
|
+
const notificationsLinkEntry = {
|
|
1524
|
+
name: "notifications link",
|
|
1525
|
+
description: "Link your server account to your GitHub account by signing in with the provider",
|
|
1526
|
+
positionals: [],
|
|
1527
|
+
options: [{
|
|
1528
|
+
key: "provider",
|
|
1529
|
+
flag: "--provider",
|
|
1530
|
+
type: "input",
|
|
1531
|
+
message: "Which notifications provider (blank = the only one that can sign members in):"
|
|
1532
|
+
}],
|
|
1533
|
+
supportsDryRun: true
|
|
1534
|
+
};
|
|
1535
|
+
//#endregion
|
|
1536
|
+
//#region src/commands/notifications-setup/notifications-setup.entry.ts
|
|
1537
|
+
const notificationsSetupEntry = {
|
|
1538
|
+
name: "notifications setup",
|
|
1539
|
+
description: "Apply the server layout a notifications provider declares in holocron.config.ts",
|
|
1540
|
+
positionals: [],
|
|
1541
|
+
supportsDryRun: true
|
|
1542
|
+
};
|
|
1543
|
+
//#endregion
|
|
1544
|
+
//#region src/commands/notifications-sync-roles/notifications-sync-roles.entry.ts
|
|
1545
|
+
const notificationsSyncRolesEntry = {
|
|
1546
|
+
name: "notifications sync-roles",
|
|
1547
|
+
description: "Make who holds a server role match a team, through the links file",
|
|
1548
|
+
positionals: [],
|
|
1549
|
+
options: [{
|
|
1550
|
+
key: "provider",
|
|
1551
|
+
flag: "--provider",
|
|
1552
|
+
type: "input",
|
|
1553
|
+
message: "Which notifications provider (blank = the only one that can manage roles):"
|
|
1554
|
+
}, {
|
|
1555
|
+
key: "keep",
|
|
1556
|
+
flag: "--keep",
|
|
1557
|
+
type: "confirm",
|
|
1558
|
+
default: false,
|
|
1559
|
+
message: "Keep the role on linked people who left the team (only add, never remove)?"
|
|
1560
|
+
}],
|
|
1561
|
+
supportsDryRun: true
|
|
1562
|
+
};
|
|
1563
|
+
//#endregion
|
|
1564
|
+
//#region src/commands/npm-bump-versions/npm-bump-versions.entry.ts
|
|
1565
|
+
const npmBumpVersionsEntry = {
|
|
1566
|
+
name: "package bump-versions",
|
|
1567
|
+
description: "Bump all non-private package versions in lockstep (semantic-release prepareCmd)",
|
|
1568
|
+
positionals: [{
|
|
1569
|
+
key: "newVersion",
|
|
1570
|
+
cliArg: "new-version",
|
|
1571
|
+
message: "New version:",
|
|
1572
|
+
type: "input"
|
|
1573
|
+
}],
|
|
1574
|
+
supportsDryRun: true
|
|
1575
|
+
};
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region src/commands/plugin-create/plugin-create.entry.ts
|
|
1578
|
+
const pluginCreateEntry = {
|
|
1579
|
+
name: "new plugin",
|
|
1580
|
+
description: "Scaffold a new @theholocron/holocron-plugin-<slug> package",
|
|
1581
|
+
positionals: [{
|
|
1582
|
+
key: "slug",
|
|
1583
|
+
message: "Package slug (kebab-case):",
|
|
1584
|
+
type: "input"
|
|
1585
|
+
}, {
|
|
1586
|
+
key: "vendor",
|
|
1587
|
+
message: "Vendor display name (PascalCase):",
|
|
1588
|
+
type: "input"
|
|
1589
|
+
}],
|
|
1590
|
+
supportsDryRun: true
|
|
1591
|
+
};
|
|
1592
|
+
//#endregion
|
|
1593
|
+
//#region src/commands/probe/probe.entry.ts
|
|
1594
|
+
const probeEntry = {
|
|
1595
|
+
name: "probe",
|
|
1596
|
+
description: "Poke a live provider on purpose: inspect it, or run a proof that cleans up after itself",
|
|
1597
|
+
positionals: [],
|
|
1598
|
+
opensMenu: true
|
|
1599
|
+
};
|
|
1600
|
+
//#endregion
|
|
1601
|
+
//#region src/commands/publish/publish.entry.ts
|
|
1334
1602
|
const PUBLISH_TAG_OPTION = {
|
|
1335
1603
|
key: "tag",
|
|
1336
1604
|
flag: "--tag",
|
|
@@ -1346,44 +1614,22 @@ const PUBLISH_OTP_OPTION = {
|
|
|
1346
1614
|
required: Boolean(env.get("HOLOCRON_NPM_ENFORCE_2FA")),
|
|
1347
1615
|
message: "One-time password (2FA), if npm requires it for this publish:"
|
|
1348
1616
|
};
|
|
1617
|
+
//#endregion
|
|
1618
|
+
//#region src/interactive-menu/command-registry/command-registry.ts
|
|
1349
1619
|
/**
|
|
1350
|
-
* The full command surface
|
|
1351
|
-
*
|
|
1352
|
-
* `run <task>` has no entry
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
1358
|
-
* `holocron run <task> <job> -- <args>` directly is one step away for
|
|
1359
|
-
* everything else. `run lint commit-msg <file>` stays excluded entirely:
|
|
1360
|
-
* it's invoked exclusively from `.husky/commit-msg "$1"`, never typed by a
|
|
1361
|
-
* human.
|
|
1620
|
+
* The full command surface for the interactive menu. Each entry lives next to the command it describes
|
|
1621
|
+
* (`commands/<name>/<name>.entry.ts`) and is listed here in menu order; this module does not introspect yargs at runtime.
|
|
1622
|
+
* `run <task>` has no entry of its own: the bare-`holocron` menu merges in {@link buildRunMenuEntries}'s dynamically-built
|
|
1623
|
+
* ones instead, since the task namespace is this repo's own resolved manifest, not a static set this module can
|
|
1624
|
+
* enumerate. `job` and `passthrough` stay un-prompted either way; picking a task and running it plain covers the
|
|
1625
|
+
* common case, and typing `holocron run <task> <job> -- <args>` directly is one step away for everything else.
|
|
1626
|
+
* `run lint commit-msg <file>` stays excluded entirely: it's invoked exclusively from `.husky/commit-msg "$1"`, never
|
|
1627
|
+
* typed by a human.
|
|
1362
1628
|
*/
|
|
1363
1629
|
const COMMAND_REGISTRY = [
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
positionals: [{
|
|
1368
|
-
key: "target",
|
|
1369
|
-
message: "org/repo to clone (or a bare org to clone every repo in it):",
|
|
1370
|
-
type: "input",
|
|
1371
|
-
validate: (v) => v.trim().length > 0 || "org/repo or org is required"
|
|
1372
|
-
}],
|
|
1373
|
-
supportsDryRun: true
|
|
1374
|
-
},
|
|
1375
|
-
{
|
|
1376
|
-
name: "doctor",
|
|
1377
|
-
description: "Load the config and run a smoke check against every provider",
|
|
1378
|
-
positionals: [],
|
|
1379
|
-
supportsDryRun: true
|
|
1380
|
-
},
|
|
1381
|
-
{
|
|
1382
|
-
name: "probe",
|
|
1383
|
-
description: "Poke a live provider on purpose: inspect it, or run a proof that cleans up after itself",
|
|
1384
|
-
positionals: [],
|
|
1385
|
-
opensMenu: true
|
|
1386
|
-
},
|
|
1630
|
+
cloneEntry,
|
|
1631
|
+
doctorEntry,
|
|
1632
|
+
probeEntry,
|
|
1387
1633
|
{
|
|
1388
1634
|
name: "repo setup",
|
|
1389
1635
|
description: "Apply infra setup actions across every configured capability",
|
|
@@ -1410,148 +1656,17 @@ const COMMAND_REGISTRY = [
|
|
|
1410
1656
|
}],
|
|
1411
1657
|
supportsDryRun: true
|
|
1412
1658
|
},
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
name: "doctor notifications",
|
|
1425
|
-
description: "Check the layout against the server and the secrets store, step by step (a full run leaves one test post in the test channel; --built-only posts nothing unless --deliver)",
|
|
1426
|
-
positionals: [],
|
|
1427
|
-
options: [{
|
|
1428
|
-
key: "deliver",
|
|
1429
|
-
flag: "--deliver",
|
|
1430
|
-
type: "confirm",
|
|
1431
|
-
default: false,
|
|
1432
|
-
message: "Post a test message through every channel's webhook (each removes itself)?"
|
|
1433
|
-
}],
|
|
1434
|
-
supportsDryRun: false
|
|
1435
|
-
},
|
|
1436
|
-
{
|
|
1437
|
-
name: "notifications setup",
|
|
1438
|
-
description: "Apply the server layout a notifications provider declares in holocron.config.ts",
|
|
1439
|
-
positionals: [],
|
|
1440
|
-
supportsDryRun: true
|
|
1441
|
-
},
|
|
1442
|
-
{
|
|
1443
|
-
name: "notifications create-server",
|
|
1444
|
-
description: "Create the server the layout describes, apply it, invite its owner and hand it over",
|
|
1445
|
-
positionals: [],
|
|
1446
|
-
options: [
|
|
1447
|
-
{
|
|
1448
|
-
key: "name",
|
|
1449
|
-
flag: "--name",
|
|
1450
|
-
type: "input",
|
|
1451
|
-
message: "What the new server is called (blank when resuming):"
|
|
1452
|
-
},
|
|
1453
|
-
{
|
|
1454
|
-
key: "owner",
|
|
1455
|
-
flag: "--owner",
|
|
1456
|
-
type: "input",
|
|
1457
|
-
required: true,
|
|
1458
|
-
message: "Member id of the person who will own it:"
|
|
1459
|
-
},
|
|
1460
|
-
{
|
|
1461
|
-
key: "force",
|
|
1462
|
-
flag: "--force",
|
|
1463
|
-
type: "confirm",
|
|
1464
|
-
default: false,
|
|
1465
|
-
message: "The config already names a server: create another and replace its id?"
|
|
1466
|
-
},
|
|
1467
|
-
{
|
|
1468
|
-
key: "resume",
|
|
1469
|
-
flag: "--resume",
|
|
1470
|
-
type: "confirm",
|
|
1471
|
-
default: false,
|
|
1472
|
-
message: "Finish an earlier run (the server exists): invite the owner and hand it over?"
|
|
1473
|
-
}
|
|
1474
|
-
],
|
|
1475
|
-
supportsDryRun: true
|
|
1476
|
-
},
|
|
1477
|
-
{
|
|
1478
|
-
name: "notifications link",
|
|
1479
|
-
description: "Link your server account to your GitHub account by signing in with the provider",
|
|
1480
|
-
positionals: [],
|
|
1481
|
-
options: [{
|
|
1482
|
-
key: "provider",
|
|
1483
|
-
flag: "--provider",
|
|
1484
|
-
type: "input",
|
|
1485
|
-
message: "Which notifications provider (blank = the only one that can sign members in):"
|
|
1486
|
-
}],
|
|
1487
|
-
supportsDryRun: true
|
|
1488
|
-
},
|
|
1489
|
-
{
|
|
1490
|
-
name: "notifications sync-roles",
|
|
1491
|
-
description: "Make who holds a server role match a team, through the links file",
|
|
1492
|
-
positionals: [],
|
|
1493
|
-
options: [{
|
|
1494
|
-
key: "provider",
|
|
1495
|
-
flag: "--provider",
|
|
1496
|
-
type: "input",
|
|
1497
|
-
message: "Which notifications provider (blank = the only one that can manage roles):"
|
|
1498
|
-
}, {
|
|
1499
|
-
key: "keep",
|
|
1500
|
-
flag: "--keep",
|
|
1501
|
-
type: "confirm",
|
|
1502
|
-
default: false,
|
|
1503
|
-
message: "Keep the role on linked people who left the team (only add, never remove)?"
|
|
1504
|
-
}],
|
|
1505
|
-
supportsDryRun: true
|
|
1506
|
-
},
|
|
1507
|
-
{
|
|
1508
|
-
name: "deploy",
|
|
1509
|
-
description: "Trigger a deployment via the configured `deployment` capability",
|
|
1510
|
-
positionals: [{
|
|
1511
|
-
key: "branch",
|
|
1512
|
-
message: "Branch to deploy:",
|
|
1513
|
-
type: "input"
|
|
1514
|
-
}],
|
|
1515
|
-
supportsDryRun: true
|
|
1516
|
-
},
|
|
1517
|
-
{
|
|
1518
|
-
name: "deploy cleanup-preview",
|
|
1519
|
-
description: "List and delete Cloudflare Pages preview deployments for a GitHub PR",
|
|
1520
|
-
positionals: [{
|
|
1521
|
-
key: "pr",
|
|
1522
|
-
message: "PR number:",
|
|
1523
|
-
type: "input",
|
|
1524
|
-
validate: numeric
|
|
1525
|
-
}],
|
|
1526
|
-
supportsDryRun: true
|
|
1527
|
-
},
|
|
1528
|
-
{
|
|
1529
|
-
name: "deploy on-release",
|
|
1530
|
-
description: "Deploy every workspace package whose delivery.deploy task is `on: release`",
|
|
1531
|
-
positionals: [],
|
|
1532
|
-
supportsDryRun: true
|
|
1533
|
-
},
|
|
1534
|
-
{
|
|
1535
|
-
name: "monitoring check",
|
|
1536
|
-
description: "Run every configured `monitoring` check against a given URL instead of its own configured url",
|
|
1537
|
-
positionals: [{
|
|
1538
|
-
key: "url",
|
|
1539
|
-
message: "URL to test against:",
|
|
1540
|
-
type: "input"
|
|
1541
|
-
}],
|
|
1542
|
-
supportsDryRun: false
|
|
1543
|
-
},
|
|
1544
|
-
{
|
|
1545
|
-
name: "package bump-versions",
|
|
1546
|
-
description: "Bump all non-private package versions in lockstep (semantic-release prepareCmd)",
|
|
1547
|
-
positionals: [{
|
|
1548
|
-
key: "newVersion",
|
|
1549
|
-
cliArg: "new-version",
|
|
1550
|
-
message: "New version:",
|
|
1551
|
-
type: "input"
|
|
1552
|
-
}],
|
|
1553
|
-
supportsDryRun: true
|
|
1554
|
-
},
|
|
1659
|
+
notificationsChannelAddEntry,
|
|
1660
|
+
doctorNotificationsEntry,
|
|
1661
|
+
notificationsSetupEntry,
|
|
1662
|
+
notificationsCreateServerEntry,
|
|
1663
|
+
notificationsLinkEntry,
|
|
1664
|
+
notificationsSyncRolesEntry,
|
|
1665
|
+
deployEntry,
|
|
1666
|
+
cleanupPreviewEntry,
|
|
1667
|
+
deployOnReleaseEntry,
|
|
1668
|
+
monitoringCheckEntry,
|
|
1669
|
+
npmBumpVersionsEntry,
|
|
1555
1670
|
{
|
|
1556
1671
|
name: "package publish",
|
|
1557
1672
|
description: "Publish @theholocron/* packages to npm",
|
|
@@ -1631,31 +1746,9 @@ const COMMAND_REGISTRY = [
|
|
|
1631
1746
|
positionals: [],
|
|
1632
1747
|
supportsDryRun: true
|
|
1633
1748
|
},
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
positionals: []
|
|
1638
|
-
},
|
|
1639
|
-
{
|
|
1640
|
-
name: "new repo",
|
|
1641
|
-
description: "Scaffold a new repo from a GitHub template (e.g. cli, react, nextjs, node, monorepo, base)",
|
|
1642
|
-
positionals: [],
|
|
1643
|
-
supportsDryRun: true
|
|
1644
|
-
},
|
|
1645
|
-
{
|
|
1646
|
-
name: "new plugin",
|
|
1647
|
-
description: "Scaffold a new @theholocron/holocron-plugin-<slug> package",
|
|
1648
|
-
positionals: [{
|
|
1649
|
-
key: "slug",
|
|
1650
|
-
message: "Package slug (kebab-case):",
|
|
1651
|
-
type: "input"
|
|
1652
|
-
}, {
|
|
1653
|
-
key: "vendor",
|
|
1654
|
-
message: "Vendor display name (PascalCase):",
|
|
1655
|
-
type: "input"
|
|
1656
|
-
}],
|
|
1657
|
-
supportsDryRun: true
|
|
1658
|
-
},
|
|
1749
|
+
configShowEntry,
|
|
1750
|
+
newRepoEntry,
|
|
1751
|
+
pluginCreateEntry,
|
|
1659
1752
|
{
|
|
1660
1753
|
name: "skills install",
|
|
1661
1754
|
description: "Copy skills from @theholocron/skills into .agents/ with agent symlinks",
|
|
@@ -1691,40 +1784,10 @@ const COMMAND_REGISTRY = [
|
|
|
1691
1784
|
positionals: [],
|
|
1692
1785
|
supportsDryRun: true
|
|
1693
1786
|
},
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
key: "provider",
|
|
1699
|
-
message: "Provider name:",
|
|
1700
|
-
type: "input"
|
|
1701
|
-
}]
|
|
1702
|
-
},
|
|
1703
|
-
{
|
|
1704
|
-
name: "auth unset",
|
|
1705
|
-
description: "Remove a stored bootstrap token",
|
|
1706
|
-
positionals: [{
|
|
1707
|
-
key: "provider",
|
|
1708
|
-
message: "Provider:",
|
|
1709
|
-
type: "select",
|
|
1710
|
-
choices: listStoredProviders
|
|
1711
|
-
}]
|
|
1712
|
-
},
|
|
1713
|
-
{
|
|
1714
|
-
name: "auth check",
|
|
1715
|
-
description: "Re-verify a stored bootstrap token",
|
|
1716
|
-
positionals: [{
|
|
1717
|
-
key: "provider",
|
|
1718
|
-
message: "Provider:",
|
|
1719
|
-
type: "select",
|
|
1720
|
-
choices: listStoredProviders
|
|
1721
|
-
}]
|
|
1722
|
-
},
|
|
1723
|
-
{
|
|
1724
|
-
name: "auth list",
|
|
1725
|
-
description: "List every provider with a stored bootstrap token",
|
|
1726
|
-
positionals: []
|
|
1727
|
-
}
|
|
1787
|
+
authSetEntry,
|
|
1788
|
+
authUnsetEntry,
|
|
1789
|
+
authCheckEntry,
|
|
1790
|
+
authListEntry
|
|
1728
1791
|
];
|
|
1729
1792
|
/** Look up a {@link CommandEntry} by its full name — for Layer 3 call sites in `cli.ts`. */
|
|
1730
1793
|
function getEntry(name) {
|
|
@@ -5670,6 +5733,32 @@ const doctorCommand = {
|
|
|
5670
5733
|
}
|
|
5671
5734
|
};
|
|
5672
5735
|
//#endregion
|
|
5736
|
+
//#region src/commands/menu/menu.command.ts
|
|
5737
|
+
/**
|
|
5738
|
+
* Print the dim version line once per terminal session — keyed by the
|
|
5739
|
+
* parent shell's PID, since that's stable across repeated bare `holocron`
|
|
5740
|
+
* invocations in the same shell but changes in a new tab/window. A marker
|
|
5741
|
+
* file in the OS tmpdir tracks whether this shell has already seen it, so
|
|
5742
|
+
* re-running `holocron` doesn't repeat the line every time.
|
|
5743
|
+
*/
|
|
5744
|
+
function printVersionHeaderOnce(version) {
|
|
5745
|
+
const marker = join(tmpdir(), `.holocron-version-shown-${process.ppid}`);
|
|
5746
|
+
if (existsSync(marker)) return;
|
|
5747
|
+
console.log(style.dim(`v${version}`));
|
|
5748
|
+
writeFileSync(marker, "");
|
|
5749
|
+
}
|
|
5750
|
+
/** Bare `holocron` (hidden from --help): a menu of every command, with this repo's runnable tasks merged in. */
|
|
5751
|
+
const menuCommand = (version) => ({
|
|
5752
|
+
command: "$0",
|
|
5753
|
+
describe: false,
|
|
5754
|
+
builder: (y) => y,
|
|
5755
|
+
handler: async (argv) => {
|
|
5756
|
+
printVersionHeaderOnce(version);
|
|
5757
|
+
const runEntries = buildRunMenuEntries(await listRunnableTasks(argv));
|
|
5758
|
+
await launchMenu([...COMMAND_REGISTRY, ...runEntries], argv);
|
|
5759
|
+
}
|
|
5760
|
+
});
|
|
5761
|
+
//#endregion
|
|
5673
5762
|
//#region src/commands/monitoring-check/monitoring-check.ts
|
|
5674
5763
|
/**
|
|
5675
5764
|
* `holocron monitoring check <url>` — runs every configured `monitoring`
|
|
@@ -14585,19 +14674,10 @@ const skillsUpdate = {
|
|
|
14585
14674
|
}).status === "fail") process.exitCode = 1;
|
|
14586
14675
|
}
|
|
14587
14676
|
};
|
|
14588
|
-
/** Bare `holocron skills`: a menu of the subcommands (hidden from --help). */
|
|
14589
|
-
const skillsMenu = {
|
|
14590
|
-
command: "$0",
|
|
14591
|
-
describe: false,
|
|
14592
|
-
builder: (y) => y,
|
|
14593
|
-
handler: async (argv) => {
|
|
14594
|
-
await launchGroupMenu("skills", argv);
|
|
14595
|
-
}
|
|
14596
|
-
};
|
|
14597
14677
|
const skillsCommand = {
|
|
14598
14678
|
command: "skills",
|
|
14599
14679
|
describe: "Manage agent skills from the @theholocron/skills registry",
|
|
14600
|
-
builder: (y) => y.command(skillsInstall).command(skillsRemove).command(skillsUpdate).command(
|
|
14680
|
+
builder: (y) => y.command(skillsInstall).command(skillsRemove).command(skillsUpdate).command(groupMenu("skills")),
|
|
14601
14681
|
handler: () => {}
|
|
14602
14682
|
};
|
|
14603
14683
|
//#endregion
|
|
@@ -15019,19 +15099,6 @@ async function checkForUpdates(currentVersion) {
|
|
|
15019
15099
|
const { version: CLI_VERSION } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
15020
15100
|
/** Whether to print the correlation id at command end (`--debug` / `--verbose`). */
|
|
15021
15101
|
let printRunId = false;
|
|
15022
|
-
/**
|
|
15023
|
-
* Print the dim version line once per terminal session — keyed by the
|
|
15024
|
-
* parent shell's PID, since that's stable across repeated bare `holocron`
|
|
15025
|
-
* invocations in the same shell but changes in a new tab/window. A marker
|
|
15026
|
-
* file in the OS tmpdir tracks whether this shell has already seen it, so
|
|
15027
|
-
* re-running `holocron` doesn't repeat the line every time.
|
|
15028
|
-
*/
|
|
15029
|
-
function printVersionHeaderOnce() {
|
|
15030
|
-
const marker = join(tmpdir(), `.holocron-version-shown-${process.ppid}`);
|
|
15031
|
-
if (existsSync(marker)) return;
|
|
15032
|
-
console.log(style.dim(`v${CLI_VERSION}`));
|
|
15033
|
-
writeFileSync(marker, "");
|
|
15034
|
-
}
|
|
15035
15102
|
init(CLI_VERSION);
|
|
15036
15103
|
const updateCheckPromise = checkForUpdates(CLI_VERSION);
|
|
15037
15104
|
let finishCommand = () => {};
|
|
@@ -15081,11 +15148,7 @@ try {
|
|
|
15081
15148
|
org: argv.org
|
|
15082
15149
|
});
|
|
15083
15150
|
finishCommand = startCommand(name);
|
|
15084
|
-
}).command(cloneCommand).command(doctorCommand).command(skillsCommand).command(runCommand).command(configShowCommand).command(authCommand).command(
|
|
15085
|
-
printVersionHeaderOnce();
|
|
15086
|
-
const runEntries = buildRunMenuEntries(await listRunnableTasks(argv));
|
|
15087
|
-
await launchMenu([...COMMAND_REGISTRY, ...runEntries], argv);
|
|
15088
|
-
}).command(repoCommand).command(newCommand).command(probeCommand).command(secretsCommand).command(notificationsCommand).command(syncCommand).command(packageCommand).command(deployCommand).command(monitoringCommand).strict().help().epilogue(`Execution contexts:
|
|
15151
|
+
}).command(cloneCommand).command(doctorCommand).command(skillsCommand).command(runCommand).command(configShowCommand).command(authCommand).command(menuCommand(CLI_VERSION)).command(repoCommand).command(newCommand).command(probeCommand).command(secretsCommand).command(notificationsCommand).command(syncCommand).command(packageCommand).command(deployCommand).command(monitoringCommand).strict().help().epilogue(`Execution contexts:
|
|
15089
15152
|
global works from a bare 'npm i -g': ${commandsInContext("global").join(", ")}\n repo-aware needs ./holocron.config in cwd: ${commandsInContext("repo-aware").join(", ")}\n workspace also needs the plugin packages: ${commandsInContext("workspace").join(", ")}\n https://theholocron.github.io/holocron/execution-contexts`).fail((msg, err) => {
|
|
15090
15153
|
if (err instanceof Error && USER_FACING_ERRORS.has(err.name)) {
|
|
15091
15154
|
captureException(err);
|