@vibgrate/cli 1.0.58 → 1.0.60

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/DOCS.md CHANGED
@@ -283,15 +283,18 @@ Upload is always optional. Best-effort by default — use `--strict` in CI if yo
283
283
  Generate an HMAC-signed DSN token for API authentication.
284
284
 
285
285
  ```bash
286
- vibgrate dsn create --workspace <id> [--region <region>] [--ingest <url>] [--write <path>]
286
+ vibgrate dsn create --workspace <id|new> [--region <region>] [--ingest <url>] [--write <path>]
287
287
  ```
288
288
 
289
- | Flag | Default | Description |
290
- | ------------- | ---------- | -------------------------------------------- |
291
- | `--workspace` | _required_ | Your workspace ID |
292
- | `--region` | `us` | Data residency region (`us`, `eu`) |
293
- | `--ingest` | — | Custom ingest API URL (overrides `--region`) |
294
- | `--write` | — | Write DSN to a file (add to `.gitignore`!) |
289
+ | Flag | Default | Description |
290
+ | ------------- | ---------- | --------------------------------------------------------------------------- |
291
+ | `--workspace` | _required_ | Your workspace ID, or `new` to auto-generate a workspace |
292
+ | `--region` | `us` | Data residency region (`us`, `eu`) |
293
+ | `--ingest` | — | Custom ingest API URL (overrides `--region`) |
294
+ | `--write` | — | Write DSN to a file (add to `.gitignore`!) |
295
+
296
+ When using `--workspace new`, the CLI auto-generates a workspace ID and provisions the DSN
297
+ with the Vibgrate API. Rate limited to 1 new DSN per 5 minutes per IP address.
295
298
 
296
299
  ---
297
300
 
package/README.md CHANGED
@@ -78,6 +78,23 @@ Add an npm script:
78
78
 
79
79
  ---
80
80
 
81
+ ## Quick start with AI assistants
82
+
83
+ Paste this prompt into your AI coding tool (GitHub Copilot, Cursor, Claude, etc.) to get started:
84
+
85
+ ```
86
+ Set up Vibgrate for upgrade drift tracking:
87
+ 1. Install: npm install -g @vibgrate/cli@latest
88
+ 2. Create DSN: npx vibgrate dsn create --workspace new
89
+ 3. Save DSN: echo 'export VIBGRATE_DSN="<dsn>"' >> ~/.zshrc && source ~/.zshrc
90
+ 4. Scan: npx vibgrate scan . --push
91
+ Then explain my drift score and top 3 upgrade priorities.
92
+ ```
93
+
94
+ See [docs/QUICKSTART-PROMPT.md](./docs/QUICKSTART-PROMPT.md) for the full onboarding prompt.
95
+
96
+ ---
97
+
81
98
  ## What the report contains
82
99
 
83
100
  Every scan includes:
@@ -181,7 +198,7 @@ vibgrate baseline [path]
181
198
  vibgrate report [--in <artifact.json>] [--format md|text|json]
182
199
  vibgrate push [--dsn <dsn>] [--file <artifact.json>] [--strict]
183
200
  vibgrate init [path] [--baseline] [--yes]
184
- vibgrate dsn create --workspace <id> [--region us|eu] [--write <path>]
201
+ vibgrate dsn create --workspace <id|new> [--region us|eu] [--write <path>]
185
202
  ```
186
203
 
187
204
  ### Command examples with expected results
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  baselineCommand,
3
3
  runBaseline
4
- } from "./chunk-KLJ5NIGX.js";
5
- import "./chunk-H473HICY.js";
4
+ } from "./chunk-ZE2RZFB4.js";
5
+ import "./chunk-BEASN7E5.js";
6
6
  import "./chunk-43ACU2WV.js";
7
7
  export {
8
8
  baselineCommand,
@@ -1092,9 +1092,28 @@ function resolveIngestHost(region, ingest) {
1092
1092
  }
1093
1093
  return host;
1094
1094
  }
1095
+ async function provisionDsn(keyId, secret, workspaceId, ingestHost) {
1096
+ const url = `https://${ingestHost}/v1/provision`;
1097
+ try {
1098
+ const response = await fetch(url, {
1099
+ method: "POST",
1100
+ headers: {
1101
+ "Content-Type": "application/json"
1102
+ },
1103
+ body: JSON.stringify({ keyId, secret, workspaceId })
1104
+ });
1105
+ if (!response.ok) {
1106
+ const result = await response.json();
1107
+ return { success: false, error: result.error || `HTTP ${response.status}` };
1108
+ }
1109
+ return { success: true };
1110
+ } catch (e) {
1111
+ return { success: false, error: e instanceof Error ? e.message : String(e) };
1112
+ }
1113
+ }
1095
1114
  var dsnCommand = new Command("dsn").description("Manage DSN tokens");
1096
- dsnCommand.command("create").description("Create a new DSN token").option("--ingest <url>", "Ingest API URL (overrides --region)").option("--region <region>", "Data residency region (us, eu)", "us").requiredOption("--workspace <id>", "Workspace ID").option("--write <path>", "Write DSN to file").action(async (opts) => {
1097
- const keyId = crypto2.randomBytes(8).toString("hex");
1115
+ dsnCommand.command("create").description("Create a new DSN token").option("--ingest <url>", "Ingest API URL (overrides --region)").option("--region <region>", "Data residency region (us, eu)", "us").requiredOption("--workspace <id>", 'Workspace ID (use "new" to auto-generate)').option("--write <path>", "Write DSN to file").action(async (opts) => {
1116
+ const keyId = crypto2.randomBytes(12).toString("hex");
1098
1117
  const secret = crypto2.randomBytes(32).toString("hex");
1099
1118
  let ingestHost;
1100
1119
  try {
@@ -1103,7 +1122,20 @@ dsnCommand.command("create").description("Create a new DSN token").option("--ing
1103
1122
  console.error(chalk2.red(e instanceof Error ? e.message : String(e)));
1104
1123
  process.exit(1);
1105
1124
  }
1106
- const dsn = `vibgrate+https://${keyId}:${secret}@${ingestHost}/${opts.workspace}`;
1125
+ let workspaceId = opts.workspace;
1126
+ const isNewWorkspace = opts.workspace.toLowerCase() === "new";
1127
+ if (isNewWorkspace) {
1128
+ workspaceId = crypto2.randomBytes(8).toString("hex");
1129
+ console.log(chalk2.dim(`Provisioning new workspace ${workspaceId}...`));
1130
+ }
1131
+ if (isNewWorkspace) {
1132
+ const result = await provisionDsn(keyId, secret, workspaceId, ingestHost);
1133
+ if (!result.success) {
1134
+ console.error(chalk2.red(`Failed to provision DSN: ${result.error}`));
1135
+ process.exit(1);
1136
+ }
1137
+ }
1138
+ const dsn = `vibgrate+https://${keyId}:${secret}@${ingestHost}/${workspaceId}`;
1107
1139
  console.log(chalk2.green("\u2714") + " DSN created");
1108
1140
  console.log("");
1109
1141
  console.log(chalk2.bold("DSN:"));
@@ -1111,9 +1143,16 @@ dsnCommand.command("create").description("Create a new DSN token").option("--ing
1111
1143
  console.log("");
1112
1144
  console.log(chalk2.bold("Key ID:"));
1113
1145
  console.log(` ${keyId}`);
1146
+ if (isNewWorkspace) {
1147
+ console.log("");
1148
+ console.log(chalk2.bold("Workspace ID:"));
1149
+ console.log(` ${workspaceId}`);
1150
+ }
1114
1151
  console.log("");
1115
1152
  console.log(chalk2.dim("Set this as VIBGRATE_DSN in your CI environment."));
1116
- console.log(chalk2.dim("The secret must be registered on your Vibgrate ingest API."));
1153
+ if (!isNewWorkspace) {
1154
+ console.log(chalk2.dim("The secret must be registered on your Vibgrate ingest API."));
1155
+ }
1117
1156
  if (opts.write) {
1118
1157
  const writePath = path.resolve(opts.write);
1119
1158
  await writeTextFile(writePath, dsn + "\n");
@@ -8022,7 +8061,7 @@ async function runScan(rootDir, opts) {
8022
8061
  );
8023
8062
  }
8024
8063
  }
8025
- if (!maxPrivacyMode && (opts.uiPurpose || scanners?.uiPurpose?.enabled === true)) {
8064
+ if (!maxPrivacyMode && scanners?.uiPurpose?.enabled !== false) {
8026
8065
  progress.startStep("uipurpose");
8027
8066
  extended.uiPurpose = await scanUiPurpose(rootDir, fileCache);
8028
8067
  const up = extended.uiPurpose;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runScan
3
- } from "./chunk-H473HICY.js";
3
+ } from "./chunk-BEASN7E5.js";
4
4
  import {
5
5
  writeJsonFile
6
6
  } from "./chunk-43ACU2WV.js";
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  baselineCommand
4
- } from "./chunk-KLJ5NIGX.js";
4
+ } from "./chunk-ZE2RZFB4.js";
5
5
  import {
6
6
  VERSION,
7
7
  dsnCommand,
@@ -10,7 +10,7 @@ import {
10
10
  pushCommand,
11
11
  scanCommand,
12
12
  writeDefaultConfig
13
- } from "./chunk-H473HICY.js";
13
+ } from "./chunk-BEASN7E5.js";
14
14
  import {
15
15
  ensureDir,
16
16
  pathExists,
@@ -39,7 +39,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
39
39
  console.log(chalk.green("\u2714") + ` Created ${chalk.bold("vibgrate.config.ts")}`);
40
40
  }
41
41
  if (opts.baseline) {
42
- const { runBaseline } = await import("./baseline-NZZNS4UI.js");
42
+ const { runBaseline } = await import("./baseline-MNQTPXHY.js");
43
43
  await runBaseline(rootDir);
44
44
  }
45
45
  console.log("");
@@ -569,14 +569,15 @@ var detailedHelp = {
569
569
  console.log(` ${chalk5.cyan("vibgrate dsn create")} Generate a new DSN token`);
570
570
  console.log("");
571
571
  console.log(chalk5.bold("dsn create options:"));
572
- console.log(` ${chalk5.cyan("--workspace <id>")} Workspace ID ${chalk5.red("(required)")}`);
572
+ console.log(` ${chalk5.cyan("--workspace <id>")} Workspace ID or "new" to auto-generate ${chalk5.red("(required)")}`);
573
573
  console.log(` ${chalk5.cyan("--region <region>")} Data residency region: us | eu (default: us)`);
574
574
  console.log(` ${chalk5.cyan("--ingest <url>")} Override ingest API URL`);
575
575
  console.log(` ${chalk5.cyan("--write <path>")} Write the DSN to a file (add to .gitignore!)`);
576
576
  console.log("");
577
577
  console.log(chalk5.bold("Examples:"));
578
+ console.log(" vibgrate dsn create --workspace new");
578
579
  console.log(" vibgrate dsn create --workspace abc123");
579
- console.log(" vibgrate dsn create --workspace abc123 --region eu --write .vibgrate/.dsn");
580
+ console.log(" vibgrate dsn create --workspace new --region eu --write .vibgrate/.dsn");
580
581
  },
581
582
  update: () => {
582
583
  console.log("");
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  formatText,
6
6
  generateFindings,
7
7
  runScan
8
- } from "./chunk-H473HICY.js";
8
+ } from "./chunk-BEASN7E5.js";
9
9
  import "./chunk-43ACU2WV.js";
10
10
  export {
11
11
  computeDriftScore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibgrate/cli",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "description": "CLI for measuring upgrade drift across Node, .NET, Python & Java projects",
5
5
  "type": "module",
6
6
  "bin": {