commet 1.3.1 → 1.4.0

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.
Files changed (2) hide show
  1. package/dist/index.js +48 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var import_commander11 = require("commander");
30
30
  // package.json
31
31
  var package_default = {
32
32
  name: "commet",
33
- version: "1.3.1",
33
+ version: "1.4.0",
34
34
  description: "Commet CLI - Manage your billing platform from the command line",
35
35
  bin: {
36
36
  commet: "./bin/commet"
@@ -85,6 +85,7 @@ var package_default = {
85
85
  };
86
86
 
87
87
  // src/commands/create.ts
88
+ var import_node_child_process = require("child_process");
88
89
  var fs2 = __toESM(require("fs"));
89
90
  var os2 = __toESM(require("os"));
90
91
  var path2 = __toESM(require("path"));
@@ -425,6 +426,46 @@ function linkProject(dest, orgId, orgName, environment) {
425
426
  "utf8"
426
427
  );
427
428
  }
429
+ async function askSkills() {
430
+ try {
431
+ return await (0, import_prompts.confirm)({
432
+ message: `Add ${commetColor("agent skills")}?`,
433
+ default: true,
434
+ theme: promptTheme
435
+ });
436
+ } catch {
437
+ return false;
438
+ }
439
+ }
440
+ async function installSkills(projectRoot) {
441
+ const npx = process.platform === "win32" ? "npx.cmd" : "npx";
442
+ return new Promise((resolve3) => {
443
+ (0, import_node_child_process.execFile)(
444
+ npx,
445
+ [
446
+ "-y",
447
+ "--loglevel=error",
448
+ "skills",
449
+ "add",
450
+ "https://github.com/commet-labs/commet",
451
+ "--skill",
452
+ "commet"
453
+ ],
454
+ { cwd: projectRoot },
455
+ (error) => {
456
+ if (error) {
457
+ console.log(import_chalk3.default.dim(" You can install them manually by running:"));
458
+ console.log(
459
+ import_chalk3.default.dim(
460
+ " npx skills add https://github.com/commet-labs/commet --skill commet"
461
+ )
462
+ );
463
+ }
464
+ resolve3();
465
+ }
466
+ );
467
+ });
468
+ }
428
469
  var createCommand = new import_commander.Command("create").description("Create a new Commet app from a template").argument("[name]", "Project name").option(
429
470
  "-t, --template <template>",
430
471
  "Template to use (fixed, seats, metered, credits, balance-ai, balance-fixed)"
@@ -554,6 +595,7 @@ var createCommand = new import_commander.Command("create").description("Create a
554
595
  console.log(import_chalk3.default.yellow("\n\u26A0 Cancelled"));
555
596
  return;
556
597
  }
598
+ const shouldInstallSkills = await askSkills();
557
599
  const downloadSpinner = (0, import_ora2.default)("Downloading template...").start();
558
600
  try {
559
601
  await downloadTemplate(template.dir, dest, opts.ref);
@@ -603,6 +645,11 @@ var createCommand = new import_commander.Command("create").description("Create a
603
645
  keySpinner.succeed("API key created and saved to .env");
604
646
  }
605
647
  linkProject(dest, selectedOrg.id, selectedOrg.name, auth.environment);
648
+ if (shouldInstallSkills) {
649
+ const skillsSpinner = (0, import_ora2.default)("Installing agent skills...").start();
650
+ await installSkills(dest);
651
+ skillsSpinner.succeed("Agent skills installed");
652
+ }
606
653
  console.log(import_chalk3.default.green(`
607
654
  \u2713 Created ${projectName}`));
608
655
  console.log(import_chalk3.default.dim(` Template: ${template.name}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commet",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Commet CLI - Manage your billing platform from the command line",
5
5
  "bin": {
6
6
  "commet": "./bin/commet"