@decantr/cli 2.1.0 → 2.1.2

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 CHANGED
@@ -97,12 +97,13 @@ decantr health --markdown --output health.md
97
97
  decantr health --ci --fail-on error
98
98
  decantr health --ci --fail-on warn
99
99
  decantr health --prompt <finding-id>
100
+ decantr health --json --output decantr-health.json
100
101
  decantr health init-ci
101
102
  decantr health init-ci --fail-on warn --cli-version latest --force
102
103
  decantr health init-ci --project apps/registry
103
104
  ```
104
105
 
105
- Use `--json` for machines and schema validation, `--markdown` for CI summaries, and `--prompt <finding-id>` when you want a scoped remediation prompt for an AI assistant. `--ci --fail-on error` fails only when blocking errors exist; `--ci --fail-on warn` also fails on warnings.
106
+ Use `--json` for machines and schema validation, `--markdown` for CI summaries, and `--prompt <finding-id>` when you want a scoped remediation prompt for an AI assistant. The prompt command prints instructions only; it does not modify source files. `--ci --fail-on error` fails only when blocking errors exist; `--ci --fail-on warn` also fails on warnings.
106
107
 
107
108
  `decantr health init-ci` installs `.github/workflows/decantr-health.yml` for GitHub Actions. The generated workflow installs project dependencies, writes `decantr-health.json`, gates with `decantr health --ci --fail-on error --markdown --output decantr-health.md`, appends the markdown report to the GitHub step summary, and uploads both files as artifacts. Use `--force` to replace an existing workflow, `--fail-on warn` for stricter repositories, or `--cli-version <version|latest>` to pin the package used by CI. In monorepos, add `--project <path>` from the repository root; dependency install stays at the root while health runs inside the app contract and uploads artifacts from that project path.
108
109
 
@@ -111,9 +112,17 @@ Use `--json` for machines and schema validation, `--markdown` for CI summaries,
111
112
  ```bash
112
113
  decantr studio
113
114
  decantr studio --port 4319 --host 127.0.0.1
115
+ decantr studio --report decantr-health.json
114
116
  ```
115
117
 
116
- Studio is for local triage, not Decantr admin telemetry. The tabs cover Overview, Routes, Drift, Findings, Remediation, CI, and Packs without uploading source code, prompts, file paths, or project data.
118
+ Studio is for local triage, not Decantr admin telemetry. The Overview keeps the first decision simple: pick the issue to fix first, review the full AI repair prompt before copying it, switch to manual guidance or commands, and expand project details when route/runtime/pack evidence matters. The tabs cover Overview, Routes, Drift, Findings, Remediation, CI, and Packs without uploading source code, prompts, file paths, or project data.
119
+
120
+ Use report mode for customer-controlled reporting from CI artifacts:
121
+
122
+ ```bash
123
+ decantr health --json --output decantr-health.json
124
+ decantr studio --report decantr-health.json
125
+ ```
117
126
 
118
127
  If the project has explicitly enabled Decantr CLI telemetry, `new --telemetry`, `init --telemetry`, `check --telemetry`, `health`, and `studio` emit only aggregate product-activation metadata such as lifecycle command outcome, status, score, finding counts, CI failure outcome, Studio usage, and remediation prompt requests. They never upload the health report, finding evidence, local paths, route names, source code, or prompt text.
119
128
 
package/dist/bin.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-5QM6XDZU.js";
2
+ import "./chunk-3SULF2JT.js";
3
3
  import "./chunk-WDA4SHIQ.js";
4
- import "./chunk-ZUUJ24YU.js";
4
+ import "./chunk-JYEEXSUX.js";
@@ -26,7 +26,7 @@ import {
26
26
  sendCliCommandTelemetry,
27
27
  sendNewProjectCompletedTelemetry,
28
28
  writeDoctrineMap
29
- } from "./chunk-ZUUJ24YU.js";
29
+ } from "./chunk-JYEEXSUX.js";
30
30
 
31
31
  // src/index.ts
32
32
  import { existsSync as existsSync26, mkdirSync as mkdirSync12, readdirSync as readdirSync6, readFileSync as readFileSync19, writeFileSync as writeFileSync15 } from "fs";
@@ -7074,8 +7074,10 @@ ${BOLD6}Usage:${RESET13}
7074
7074
  decantr registry get-pack <manifest|scaffold|review|section|page|mutation> [id] [--namespace <namespace>] [--json] [--essence <path>] [--write-context]
7075
7075
  decantr registry critique-file <file> [--namespace <namespace>] [--json] [--essence <path>] [--treatments <path>]
7076
7076
  decantr registry audit-project [--namespace <namespace>] [--json] [--essence <path>] [--dist <path>] [--sources <dir>]
7077
+ decantr health [--format text|json|markdown] [--ci] [--fail-on error|warn|none]
7077
7078
  decantr health init-ci [--force] [--project <path>] [--fail-on <error|warn|none>] [--cli-version <version|latest>]
7078
7079
  decantr content-health [--json] [--markdown] [--ci]
7080
+ decantr studio [--port 4319] [--host 127.0.0.1] [--report decantr-health.json]
7079
7081
  decantr rules preview [--project=<path>]
7080
7082
  decantr rules apply [--project=<path>]
7081
7083
  decantr validate [path]
@@ -7159,6 +7161,7 @@ ${BOLD6}Examples:${RESET13}
7159
7161
  decantr health --ci --fail-on error
7160
7162
  decantr content-health --ci --fail-on error
7161
7163
  decantr studio
7164
+ decantr studio --report decantr-health.json
7162
7165
  decantr audit
7163
7166
  decantr audit src/pages/HomePage.tsx
7164
7167
  decantr migrate --to v4
@@ -7208,6 +7211,91 @@ ${BOLD6}Examples:${RESET13}
7208
7211
  decantr rules apply --project=apps/web
7209
7212
  `);
7210
7213
  }
7214
+ function isCommandHelpRequest(args) {
7215
+ return args[1] === "help" || args.slice(1).some((arg) => arg === "--help" || arg === "-h");
7216
+ }
7217
+ function cmdHealthHelp() {
7218
+ console.log(`
7219
+ ${BOLD6}decantr health${RESET13} \u2014 Generate a local Project Health report
7220
+
7221
+ ${BOLD6}Usage:${RESET13}
7222
+ decantr health [--format text|json|markdown] [--output <file>]
7223
+ decantr health --json
7224
+ decantr health --markdown
7225
+ decantr health --ci [--fail-on error|warn|none]
7226
+ decantr health --prompt <finding-id>
7227
+ decantr health init-ci [--force] [--project <path>] [--fail-on error|warn|none] [--cli-version <version|latest>]
7228
+
7229
+ ${BOLD6}Options:${RESET13}
7230
+ --format Output format: text, json, or markdown
7231
+ --json Emit JSON report
7232
+ --markdown Emit markdown report
7233
+ --output Write the selected report format to a file
7234
+ --ci Enable CI exit-code behavior
7235
+ --fail-on CI threshold: error, warn, or none
7236
+ --prompt Print an AI-ready remediation prompt for a finding
7237
+
7238
+ ${BOLD6}Examples:${RESET13}
7239
+ decantr health
7240
+ decantr health --json
7241
+ decantr health --markdown --output decantr-health.md
7242
+ decantr health --ci --fail-on error
7243
+ decantr health --prompt audit-essence-missing
7244
+ decantr health init-ci --project apps/web
7245
+ `);
7246
+ }
7247
+ function cmdContentHealthHelp() {
7248
+ console.log(`
7249
+ ${BOLD6}decantr content-health${RESET13} \u2014 Generate a local registry content health report
7250
+
7251
+ ${BOLD6}Usage:${RESET13}
7252
+ decantr content-health [--format text|json|markdown] [--output <file>]
7253
+ decantr content-health --json
7254
+ decantr content-health --markdown
7255
+ decantr content-health --ci [--fail-on error|warn|none]
7256
+ decantr content-health --prompt <finding-id>
7257
+
7258
+ ${BOLD6}Options:${RESET13}
7259
+ --format Output format: text, json, or markdown
7260
+ --json Emit JSON report
7261
+ --markdown Emit markdown report
7262
+ --output Write the selected report format to a file
7263
+ --ci Enable CI exit-code behavior
7264
+ --fail-on CI threshold: error, warn, or none
7265
+ --prompt Print an AI-ready remediation prompt for a finding
7266
+
7267
+ ${BOLD6}Examples:${RESET13}
7268
+ decantr content-health
7269
+ decantr content-health --json
7270
+ decantr content-health --markdown --output content-health.md
7271
+ decantr content-health --ci --fail-on error
7272
+ `);
7273
+ }
7274
+ function cmdStudioHelp() {
7275
+ console.log(`
7276
+ ${BOLD6}decantr studio${RESET13} \u2014 Run a local Project Health dashboard
7277
+
7278
+ ${BOLD6}Usage:${RESET13}
7279
+ decantr studio [--port 4319] [--host 127.0.0.1] [--report decantr-health.json]
7280
+
7281
+ ${BOLD6}Options:${RESET13}
7282
+ --port Local port to bind; defaults to 4319
7283
+ --host Local host to bind; defaults to 127.0.0.1
7284
+ --report Serve a read-only Project Health JSON artifact instead of scanning the current project
7285
+
7286
+ ${BOLD6}Endpoints:${RESET13}
7287
+ GET /
7288
+ GET /api/health
7289
+ POST /api/refresh
7290
+
7291
+ ${BOLD6}Examples:${RESET13}
7292
+ decantr studio
7293
+ decantr studio --port 4320
7294
+ decantr studio --host 127.0.0.1 --port 4319
7295
+ decantr health --json --output decantr-health.json
7296
+ decantr studio --report decantr-health.json
7297
+ `);
7298
+ }
7211
7299
  async function main() {
7212
7300
  const args = process.argv.slice(2);
7213
7301
  const command = args[0];
@@ -7333,7 +7421,7 @@ async function main() {
7333
7421
  `${YELLOW9}Note: \`decantr heal\` is deprecated. Use \`decantr check\` instead.${RESET13}`
7334
7422
  );
7335
7423
  }
7336
- const { cmdHeal } = await import("./heal-MQ56WYX4.js");
7424
+ const { cmdHeal } = await import("./heal-NWQNJ6PU.js");
7337
7425
  const telemetryFlag = args.includes("--telemetry");
7338
7426
  const brownfieldFlag = args.includes("--brownfield");
7339
7427
  await cmdHeal(process.cwd(), { telemetry: telemetryFlag, brownfield: brownfieldFlag });
@@ -7341,7 +7429,11 @@ async function main() {
7341
7429
  }
7342
7430
  case "health": {
7343
7431
  try {
7344
- const { cmdHealth, parseHealthArgs } = await import("./health-DCT625XN.js");
7432
+ if (isCommandHelpRequest(args)) {
7433
+ cmdHealthHelp();
7434
+ break;
7435
+ }
7436
+ const { cmdHealth, parseHealthArgs } = await import("./health-WJJ55W3H.js");
7345
7437
  await cmdHealth(process.cwd(), parseHealthArgs(args));
7346
7438
  } catch (e) {
7347
7439
  console.error(error3(e.message));
@@ -7351,6 +7443,10 @@ async function main() {
7351
7443
  }
7352
7444
  case "content-health": {
7353
7445
  try {
7446
+ if (isCommandHelpRequest(args)) {
7447
+ cmdContentHealthHelp();
7448
+ break;
7449
+ }
7354
7450
  const { cmdContentHealth, parseContentHealthArgs } = await import("./content-health-QQHBR6XG.js");
7355
7451
  await cmdContentHealth(process.cwd(), parseContentHealthArgs(args));
7356
7452
  } catch (e) {
@@ -7361,7 +7457,11 @@ async function main() {
7361
7457
  }
7362
7458
  case "studio": {
7363
7459
  try {
7364
- const { cmdStudio, parseStudioArgs } = await import("./studio-CI7OOGHV.js");
7460
+ if (isCommandHelpRequest(args)) {
7461
+ cmdStudioHelp();
7462
+ break;
7463
+ }
7464
+ const { cmdStudio, parseStudioArgs } = await import("./studio-7XAXWRVN.js");
7365
7465
  await cmdStudio(process.cwd(), parseStudioArgs(args));
7366
7466
  } catch (e) {
7367
7467
  console.error(error3(e.message));
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  collectCheckIssues
3
- } from "./chunk-X2HIXQAY.js";
3
+ } from "./chunk-LLQCXOHK.js";
4
4
  import {
5
5
  sendProjectHealthCiFailedTelemetry,
6
6
  sendProjectHealthPromptTelemetry,
7
7
  sendProjectHealthReportTelemetry
8
- } from "./chunk-ZUUJ24YU.js";
8
+ } from "./chunk-JYEEXSUX.js";
9
9
 
10
10
  // src/commands/health.ts
11
11
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -90,7 +90,7 @@ async function captureCliTelemetryEvent(input) {
90
90
  async function sendCliCommandTelemetry(input) {
91
91
  const projectRoot = resolveCliTelemetryProjectRoot(input.projectRoot ?? process.cwd(), input.args);
92
92
  const command = normalizeCommand(input.args[0]);
93
- if (!isOptedIn(projectRoot) || !command || command === "help" || command === "version") {
93
+ if (!isOptedIn(projectRoot) || !command || command === "help" || command === "version" || isHelpOrVersionProbe(input.args)) {
94
94
  return;
95
95
  }
96
96
  const properties = buildCliLifecycleProperties({
@@ -395,6 +395,11 @@ function normalizeCommand(command) {
395
395
  if (command === "--version" || command === "-v") return "version";
396
396
  return command;
397
397
  }
398
+ function isHelpOrVersionProbe(args) {
399
+ if (args.some((arg) => arg === "--help" || arg === "-h")) return true;
400
+ if (args[1] === "help") return true;
401
+ return false;
402
+ }
398
403
  function inferFlagValue(args, flag) {
399
404
  const equalsPrefix = `${flag}=`;
400
405
  const inline = args.find((arg) => arg.startsWith(equalsPrefix));
@@ -10,7 +10,7 @@ import {
10
10
  scanRoutes,
11
11
  scanStyling,
12
12
  sendGuardMetrics
13
- } from "./chunk-ZUUJ24YU.js";
13
+ } from "./chunk-JYEEXSUX.js";
14
14
 
15
15
  // src/commands/heal.ts
16
16
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  cmdHeal,
3
3
  collectCheckIssues
4
- } from "./chunk-X2HIXQAY.js";
5
- import "./chunk-ZUUJ24YU.js";
4
+ } from "./chunk-LLQCXOHK.js";
5
+ import "./chunk-JYEEXSUX.js";
6
6
  export {
7
7
  cmdHeal,
8
8
  collectCheckIssues
@@ -8,9 +8,9 @@ import {
8
8
  renderProjectHealthCiWorkflow,
9
9
  shouldFailHealth,
10
10
  writeProjectHealthCiWorkflow
11
- } from "./chunk-KGEEYXSU.js";
12
- import "./chunk-X2HIXQAY.js";
13
- import "./chunk-ZUUJ24YU.js";
11
+ } from "./chunk-DPFORHLL.js";
12
+ import "./chunk-LLQCXOHK.js";
13
+ import "./chunk-JYEEXSUX.js";
14
14
  export {
15
15
  cmdHealth,
16
16
  createProjectHealthReport,
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./chunk-5QM6XDZU.js";
1
+ import "./chunk-3SULF2JT.js";
2
2
  import "./chunk-WDA4SHIQ.js";
3
- import "./chunk-ZUUJ24YU.js";
3
+ import "./chunk-JYEEXSUX.js";