@principal-ai/principal-view-cli 0.1.24 → 0.1.25

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.
@@ -38,8 +38,8 @@ export function createCreateCommand() {
38
38
  console.log(chalk.bold('Next steps:'));
39
39
  console.log(` 1. Open ${chalk.cyan(`.principal-views/${options.name}.canvas`)} in your editor`);
40
40
  console.log(` 2. Add nodes and edges to define your architecture`);
41
- console.log(` 3. Run ${chalk.cyan('privu validate')} to check your configuration`);
42
- console.log(` 4. Run ${chalk.cyan('privu doctor')} to verify source mappings`);
41
+ console.log(` 3. Run ${chalk.cyan('npx @principal-ai/principal-view-cli validate')} to check your configuration`);
42
+ console.log(` 4. Run ${chalk.cyan('npx @principal-ai/principal-view-cli doctor')} to verify source mappings`);
43
43
  }
44
44
  catch (error) {
45
45
  console.error(chalk.red('Error:'), error.message);
@@ -149,7 +149,7 @@ export function createDoctorCommand() {
149
149
  }
150
150
  else {
151
151
  console.log(chalk.yellow('No .principal-views directory found.'));
152
- console.log(chalk.dim('Run "privu init" to create a configuration.'));
152
+ console.log(chalk.dim('Run "npx @principal-ai/principal-view-cli init" to create a configuration.'));
153
153
  }
154
154
  return;
155
155
  }
@@ -2,7 +2,7 @@
2
2
  * Hooks command - Manage husky pre-commit hooks for Principal View
3
3
  *
4
4
  * This command installs/removes pre-commit hooks into a target project
5
- * that will run `privu doctor` and `privu validate` before each commit.
5
+ * that will run `npx @principal-ai/principal-view-cli doctor` and `npx @principal-ai/principal-view-cli validate` before each commit.
6
6
  */
7
7
  import { Command } from 'commander';
8
8
  export declare function createHooksCommand(): Command;
@@ -2,7 +2,7 @@
2
2
  * Hooks command - Manage husky pre-commit hooks for Principal View
3
3
  *
4
4
  * This command installs/removes pre-commit hooks into a target project
5
- * that will run `privu doctor` and `privu validate` before each commit.
5
+ * that will run `npx @principal-ai/principal-view-cli doctor` and `npx @principal-ai/principal-view-cli validate` before each commit.
6
6
  */
7
7
  import { Command } from 'commander';
8
8
  import { existsSync, readFileSync, writeFileSync, unlinkSync, chmodSync } from 'node:fs';
@@ -18,17 +18,17 @@ const VV_HOOK_MARKER = '# Principal View checks';
18
18
  function getVVHookContent() {
19
19
  return `${VV_HOOK_MARKER}
20
20
  echo "Running Principal View doctor check..."
21
- npx privu doctor --errors-only || {
21
+ npx @principal-ai/principal-view-cli doctor --errors-only || {
22
22
  echo "❌ Principal View doctor check failed (errors found)"
23
- echo " Run 'privu doctor' to see details"
23
+ echo " Run 'npx @principal-ai/principal-view-cli doctor' to see details"
24
24
  exit 1
25
25
  }
26
26
 
27
27
  echo "Running Principal View canvas validation..."
28
- npx privu validate --quiet 2>/dev/null || {
28
+ npx @principal-ai/principal-view-cli validate --quiet 2>/dev/null || {
29
29
  if [ $? -ne 0 ]; then
30
30
  echo "❌ Canvas validation failed"
31
- echo " Run 'privu validate' to see details"
31
+ echo " Run 'npx @principal-ai/principal-view-cli validate' to see details"
32
32
  exit 1
33
33
  fi
34
34
  }
@@ -164,7 +164,7 @@ function removeVVHook(repoPath) {
164
164
  const line = lines[i];
165
165
  // Check if this line is part of the PV block
166
166
  if (line &&
167
- (line.includes('privu ') ||
167
+ (line.includes('@principal-ai/principal-view-cli ') ||
168
168
  line.includes('Principal View') ||
169
169
  line.includes('echo "Running Visual') ||
170
170
  (line.includes('exit 1') && i > startIndex && i < startIndex + 15) ||
@@ -222,12 +222,12 @@ export function createHooksCommand() {
222
222
  if (!isHuskyInstalled(repoPath)) {
223
223
  if (options.check) {
224
224
  console.log(chalk.red('❌ Husky is not installed'));
225
- console.log(' Run "privu hooks --init" to install husky');
225
+ console.log(' Run "npx @principal-ai/principal-view-cli hooks --init" to install husky');
226
226
  process.exit(1);
227
227
  }
228
228
  else if (options.add) {
229
229
  console.log(chalk.red('❌ Husky is not installed'));
230
- console.log(' Run "privu hooks --init" first to install husky');
230
+ console.log(' Run "npx @principal-ai/principal-view-cli hooks --init" first to install husky');
231
231
  process.exit(1);
232
232
  }
233
233
  else if (options.remove) {
@@ -237,7 +237,7 @@ export function createHooksCommand() {
237
237
  else {
238
238
  console.log(chalk.red('❌ Husky is not installed in this repository'));
239
239
  console.log('\nTo install husky and set up Principal View hooks:');
240
- console.log(' privu hooks --init --add');
240
+ console.log(' npx @principal-ai/principal-view-cli hooks --init --add');
241
241
  process.exit(1);
242
242
  }
243
243
  }
@@ -259,7 +259,7 @@ export function createHooksCommand() {
259
259
  addVVHook(repoPath);
260
260
  console.log(chalk.green('✅ Added Principal View checks to pre-commit hook'));
261
261
  console.log('\nPre-commit hook will now:');
262
- console.log(' • Run privu doctor to check for stale configurations');
262
+ console.log(' • Run npx @principal-ai/principal-view-cli doctor to check for stale configurations');
263
263
  console.log(' • Validate all .canvas files');
264
264
  }
265
265
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+GpC,wBAAgB,iBAAiB,IAAI,OAAO,CA6L3C"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+GpC,wBAAgB,iBAAiB,IAAI,OAAO,CA4L3C"}
@@ -180,8 +180,7 @@ edgeComponents: {}
180
180
  if (existsSync(preCommitFile)) {
181
181
  // Check if our hook is already in the file
182
182
  const existingContent = readFileSync(preCommitFile, 'utf8');
183
- if (existingContent.includes('principal-view-cli lint') ||
184
- existingContent.includes('privu lint')) {
183
+ if (existingContent.includes('principal-view-cli lint')) {
185
184
  console.log(chalk.yellow(`Husky pre-commit hook already includes principal view linting`));
186
185
  }
187
186
  else {
@@ -252,16 +251,16 @@ edgeComponents: {}
252
251
  console.log(chalk.bold('Next steps:'));
253
252
  console.log(` 1. Define components in ${chalk.cyan('.principal-views/library.yaml')}`);
254
253
  console.log(` 2. Build your graph in ${chalk.cyan(`.principal-views/${options.name}.canvas`)}`);
255
- console.log(` 3. Run ${chalk.cyan('privu lint')} to validate your configuration`);
254
+ console.log(` 3. Run ${chalk.cyan('npx @principal-ai/principal-view-cli lint')} to validate your configuration`);
256
255
  if (huskySetup) {
257
256
  console.log(` 4. Commits will now automatically lint .principal-views files`);
258
257
  }
259
258
  console.log('');
260
259
  console.log(chalk.bold('Commands:'));
261
- console.log(` • ${chalk.cyan('privu lint')} - Lint configuration files`);
262
- console.log(` • ${chalk.cyan('privu lint --json')} - Output lint results as JSON`);
263
- console.log(` • ${chalk.cyan('privu validate')} - Validate canvas files`);
264
- console.log(` • ${chalk.cyan('privu doctor')} - Check project setup`);
260
+ console.log(` • ${chalk.cyan('npx @principal-ai/principal-view-cli lint')} - Lint configuration files`);
261
+ console.log(` • ${chalk.cyan('npx @principal-ai/principal-view-cli lint --json')} - Output lint results as JSON`);
262
+ console.log(` • ${chalk.cyan('npx @principal-ai/principal-view-cli validate')} - Validate canvas files`);
263
+ console.log(` • ${chalk.cyan('npx @principal-ai/principal-view-cli doctor')} - Check project setup`);
265
264
  }
266
265
  catch (error) {
267
266
  console.error(chalk.red('Error:'), error.message);
@@ -49,7 +49,7 @@ export function createListCommand() {
49
49
  if (!options.all) {
50
50
  console.log(chalk.dim('Run with --all to search all directories'));
51
51
  }
52
- console.log(chalk.dim('\nTo create a new canvas, run: privu init'));
52
+ console.log(chalk.dim('\nTo create a new canvas, run: npx @principal-ai/principal-view-cli init'));
53
53
  }
54
54
  return;
55
55
  }
@@ -24,7 +24,7 @@ ${chalk.dim('│')} } ${chalk.dim(
24
24
  ${chalk.dim('│')} } ${chalk.dim('│')}
25
25
  ${chalk.dim('└─────────────────────────────────────────────────┘')}
26
26
 
27
- Run ${chalk.cyan('privu schema <section>')} for details on:
27
+ Run ${chalk.cyan('npx @principal-ai/principal-view-cli schema <section>')} for details on:
28
28
  ${chalk.yellow('nodes')} Node types and properties
29
29
  ${chalk.yellow('edges')} Edge properties and types
30
30
  ${chalk.yellow('vv')} Principal View extension fields
@@ -309,8 +309,8 @@ ${chalk.dim('─'.repeat(50))}
309
309
  }
310
310
  }
311
311
 
312
- ${chalk.bold('Run validation:')} ${chalk.cyan('privu validate <file>')}
313
- ${chalk.bold('Initialize project:')} ${chalk.cyan('privu init')}
312
+ ${chalk.bold('Run validation:')} ${chalk.cyan('npx @principal-ai/principal-view-cli validate <file>')}
313
+ ${chalk.bold('Initialize project:')} ${chalk.cyan('npx @principal-ai/principal-view-cli init')}
314
314
  `,
315
315
  };
316
316
  export function createSchemaCommand() {
@@ -848,7 +848,7 @@ export function createValidateCommand() {
848
848
  else {
849
849
  console.log(chalk.yellow('No .canvas files found matching the specified patterns.'));
850
850
  console.log(chalk.dim(`Patterns searched: ${patterns.join(', ')}`));
851
- console.log(chalk.dim('\nTo create a new .principal-views folder, run: privu init'));
851
+ console.log(chalk.dim('\nTo create a new .principal-views folder, run: npx @principal-ai/principal-view-cli init'));
852
852
  }
853
853
  return;
854
854
  }
package/dist/index.cjs CHANGED
@@ -14304,7 +14304,7 @@ function createValidateCommand() {
14304
14304
  } else {
14305
14305
  console.log(source_default.yellow("No .canvas files found matching the specified patterns."));
14306
14306
  console.log(source_default.dim(`Patterns searched: ${patterns.join(", ")}`));
14307
- console.log(source_default.dim("\nTo create a new .principal-views folder, run: privu init"));
14307
+ console.log(source_default.dim("\nTo create a new .principal-views folder, run: npx @principal-ai/principal-view-cli init"));
14308
14308
  }
14309
14309
  return;
14310
14310
  }
@@ -14528,7 +14528,7 @@ edgeComponents: {}
14528
14528
  if (isHuskyInstalled(gitRoot)) {
14529
14529
  if ((0, import_node_fs5.existsSync)(preCommitFile)) {
14530
14530
  const existingContent = (0, import_node_fs5.readFileSync)(preCommitFile, "utf8");
14531
- if (existingContent.includes("principal-view-cli lint") || existingContent.includes("privu lint")) {
14531
+ if (existingContent.includes("principal-view-cli lint")) {
14532
14532
  console.log(
14533
14533
  source_default.yellow(`Husky pre-commit hook already includes principal view linting`)
14534
14534
  );
@@ -14605,16 +14605,16 @@ edgeComponents: {}
14605
14605
  console.log(
14606
14606
  ` 2. Build your graph in ${source_default.cyan(`.principal-views/${options.name}.canvas`)}`
14607
14607
  );
14608
- console.log(` 3. Run ${source_default.cyan("privu lint")} to validate your configuration`);
14608
+ console.log(` 3. Run ${source_default.cyan("npx @principal-ai/principal-view-cli lint")} to validate your configuration`);
14609
14609
  if (huskySetup) {
14610
14610
  console.log(` 4. Commits will now automatically lint .principal-views files`);
14611
14611
  }
14612
14612
  console.log("");
14613
14613
  console.log(source_default.bold("Commands:"));
14614
- console.log(` \u2022 ${source_default.cyan("privu lint")} - Lint configuration files`);
14615
- console.log(` \u2022 ${source_default.cyan("privu lint --json")} - Output lint results as JSON`);
14616
- console.log(` \u2022 ${source_default.cyan("privu validate")} - Validate canvas files`);
14617
- console.log(` \u2022 ${source_default.cyan("privu doctor")} - Check project setup`);
14614
+ console.log(` \u2022 ${source_default.cyan("npx @principal-ai/principal-view-cli lint")} - Lint configuration files`);
14615
+ console.log(` \u2022 ${source_default.cyan("npx @principal-ai/principal-view-cli lint --json")} - Output lint results as JSON`);
14616
+ console.log(` \u2022 ${source_default.cyan("npx @principal-ai/principal-view-cli validate")} - Validate canvas files`);
14617
+ console.log(` \u2022 ${source_default.cyan("npx @principal-ai/principal-view-cli doctor")} - Check project setup`);
14618
14618
  } catch (error) {
14619
14619
  console.error(source_default.red("Error:"), error.message);
14620
14620
  process.exit(1);
@@ -14660,7 +14660,7 @@ function createListCommand() {
14660
14660
  if (!options.all) {
14661
14661
  console.log(source_default.dim("Run with --all to search all directories"));
14662
14662
  }
14663
- console.log(source_default.dim("\nTo create a new canvas, run: privu init"));
14663
+ console.log(source_default.dim("\nTo create a new canvas, run: npx @principal-ai/principal-view-cli init"));
14664
14664
  }
14665
14665
  return;
14666
14666
  }
@@ -14719,7 +14719,7 @@ ${source_default.dim("\u2502")} }
14719
14719
  ${source_default.dim("\u2502")} } ${source_default.dim("\u2502")}
14720
14720
  ${source_default.dim("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}
14721
14721
 
14722
- Run ${source_default.cyan("privu schema <section>")} for details on:
14722
+ Run ${source_default.cyan("npx @principal-ai/principal-view-cli schema <section>")} for details on:
14723
14723
  ${source_default.yellow("nodes")} Node types and properties
14724
14724
  ${source_default.yellow("edges")} Edge properties and types
14725
14725
  ${source_default.yellow("vv")} Principal View extension fields
@@ -15010,8 +15010,8 @@ ${source_default.dim("\u2500".repeat(50))}
15010
15010
  }
15011
15011
  }
15012
15012
 
15013
- ${source_default.bold("Run validation:")} ${source_default.cyan("privu validate <file>")}
15014
- ${source_default.bold("Initialize project:")} ${source_default.cyan("privu init")}
15013
+ ${source_default.bold("Run validation:")} ${source_default.cyan("npx @principal-ai/principal-view-cli validate <file>")}
15014
+ ${source_default.bold("Initialize project:")} ${source_default.cyan("npx @principal-ai/principal-view-cli init")}
15015
15015
  `
15016
15016
  };
15017
15017
  function createSchemaCommand() {
@@ -15152,7 +15152,7 @@ function createDoctorCommand() {
15152
15152
  );
15153
15153
  } else {
15154
15154
  console.log(source_default.yellow("No .principal-views directory found."));
15155
- console.log(source_default.dim('Run "privu init" to create a configuration.'));
15155
+ console.log(source_default.dim('Run "npx @principal-ai/principal-view-cli init" to create a configuration.'));
15156
15156
  }
15157
15157
  return;
15158
15158
  }
@@ -15290,17 +15290,17 @@ var VV_HOOK_MARKER = "# Principal View checks";
15290
15290
  function getVVHookContent() {
15291
15291
  return `${VV_HOOK_MARKER}
15292
15292
  echo "Running Principal View doctor check..."
15293
- npx privu doctor --errors-only || {
15293
+ npx @principal-ai/principal-view-cli doctor --errors-only || {
15294
15294
  echo "\u274C Principal View doctor check failed (errors found)"
15295
- echo " Run 'privu doctor' to see details"
15295
+ echo " Run 'npx @principal-ai/principal-view-cli doctor' to see details"
15296
15296
  exit 1
15297
15297
  }
15298
15298
 
15299
15299
  echo "Running Principal View canvas validation..."
15300
- npx privu validate --quiet 2>/dev/null || {
15300
+ npx @principal-ai/principal-view-cli validate --quiet 2>/dev/null || {
15301
15301
  if [ $? -ne 0 ]; then
15302
15302
  echo "\u274C Canvas validation failed"
15303
- echo " Run 'privu validate' to see details"
15303
+ echo " Run 'npx @principal-ai/principal-view-cli validate' to see details"
15304
15304
  exit 1
15305
15305
  fi
15306
15306
  }
@@ -15401,7 +15401,7 @@ function removeVVHook(repoPath) {
15401
15401
  let i = startIndex + 1;
15402
15402
  while (i < lines.length && inVVBlock) {
15403
15403
  const line = lines[i];
15404
- if (line && (line.includes("privu ") || line.includes("Principal View") || line.includes('echo "Running Visual') || line.includes("exit 1") && i > startIndex && i < startIndex + 15 || line === "}" && i > startIndex && i < startIndex + 15 || line.trim() === "" && i === startIndex + 1)) {
15404
+ if (line && (line.includes("@principal-ai/principal-view-cli ") || line.includes("Principal View") || line.includes('echo "Running Visual') || line.includes("exit 1") && i > startIndex && i < startIndex + 15 || line === "}" && i > startIndex && i < startIndex + 15 || line.trim() === "" && i === startIndex + 1)) {
15405
15405
  endIndex = i;
15406
15406
  i++;
15407
15407
  } else if (line && line.trim() === "" && i < startIndex + 15) {
@@ -15436,11 +15436,11 @@ function createHooksCommand() {
15436
15436
  if (!isHuskyInstalled2(repoPath)) {
15437
15437
  if (options.check) {
15438
15438
  console.log(source_default.red("\u274C Husky is not installed"));
15439
- console.log(' Run "privu hooks --init" to install husky');
15439
+ console.log(' Run "npx @principal-ai/principal-view-cli hooks --init" to install husky');
15440
15440
  process.exit(1);
15441
15441
  } else if (options.add) {
15442
15442
  console.log(source_default.red("\u274C Husky is not installed"));
15443
- console.log(' Run "privu hooks --init" first to install husky');
15443
+ console.log(' Run "npx @principal-ai/principal-view-cli hooks --init" first to install husky');
15444
15444
  process.exit(1);
15445
15445
  } else if (options.remove) {
15446
15446
  console.log("\u2139\uFE0F Husky is not installed");
@@ -15448,7 +15448,7 @@ function createHooksCommand() {
15448
15448
  } else {
15449
15449
  console.log(source_default.red("\u274C Husky is not installed in this repository"));
15450
15450
  console.log("\nTo install husky and set up Principal View hooks:");
15451
- console.log(" privu hooks --init --add");
15451
+ console.log(" npx @principal-ai/principal-view-cli hooks --init --add");
15452
15452
  process.exit(1);
15453
15453
  }
15454
15454
  }
@@ -15467,7 +15467,7 @@ function createHooksCommand() {
15467
15467
  addVVHook(repoPath);
15468
15468
  console.log(source_default.green("\u2705 Added Principal View checks to pre-commit hook"));
15469
15469
  console.log("\nPre-commit hook will now:");
15470
- console.log(" \u2022 Run privu doctor to check for stale configurations");
15470
+ console.log(" \u2022 Run npx @principal-ai/principal-view-cli doctor to check for stale configurations");
15471
15471
  console.log(" \u2022 Validate all .canvas files");
15472
15472
  }
15473
15473
  } else if (options.remove) {
@@ -15533,8 +15533,8 @@ function createCreateCommand() {
15533
15533
  ` 1. Open ${source_default.cyan(`.principal-views/${options.name}.canvas`)} in your editor`
15534
15534
  );
15535
15535
  console.log(` 2. Add nodes and edges to define your architecture`);
15536
- console.log(` 3. Run ${source_default.cyan("privu validate")} to check your configuration`);
15537
- console.log(` 4. Run ${source_default.cyan("privu doctor")} to verify source mappings`);
15536
+ console.log(` 3. Run ${source_default.cyan("npx @principal-ai/principal-view-cli validate")} to check your configuration`);
15537
+ console.log(` 4. Run ${source_default.cyan("npx @principal-ai/principal-view-cli doctor")} to verify source mappings`);
15538
15538
  } catch (error) {
15539
15539
  console.error(source_default.red("Error:"), error.message);
15540
15540
  process.exit(1);