@vibgrate/cli 1.0.57 → 1.0.59
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 +10 -7
- package/README.md +18 -1
- package/dist/{baseline-NZZNS4UI.js → baseline-52TPOEYT.js} +2 -2
- package/dist/{chunk-H473HICY.js → chunk-HOODUFLH.js} +43 -4
- package/dist/{chunk-KLJ5NIGX.js → chunk-HPZ54BJK.js} +1 -1
- package/dist/cli.js +6 -5
- package/dist/index.js +1 -1
- package/package.json +6 -3
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
|
|
@@ -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>",
|
|
1097
|
-
const keyId = crypto2.randomBytes(
|
|
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
|
-
|
|
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
|
-
|
|
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");
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
baselineCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HPZ54BJK.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-
|
|
13
|
+
} from "./chunk-HOODUFLH.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-
|
|
42
|
+
const { runBaseline } = await import("./baseline-52TPOEYT.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
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibgrate/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"description": "CLI for measuring upgrade drift across Node, .NET, Python & Java projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,11 +19,14 @@
|
|
|
19
19
|
"DOCS.md"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsup src/cli.ts src/index.ts --format esm --dts --clean",
|
|
22
|
+
"build": "tsup src/cli.ts src/index.ts --format esm --dts --clean && pnpm test:solutions",
|
|
23
|
+
"build:only": "tsup src/cli.ts src/index.ts --format esm --dts --clean",
|
|
23
24
|
"dev": "tsx src/cli.ts",
|
|
24
25
|
"lint": "eslint src",
|
|
25
26
|
"typecheck": "tsc --noEmit",
|
|
26
|
-
"test": "vitest run"
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:solutions": "tsx test-solutions/test-runner.ts",
|
|
29
|
+
"test:all": "vitest run && pnpm test:solutions"
|
|
27
30
|
},
|
|
28
31
|
"keywords": [
|
|
29
32
|
"upgrade",
|