commet 1.3.1 → 1.4.1
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/dist/index.js +36 -1
- 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.
|
|
33
|
+
version: "1.4.1",
|
|
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,34 @@ 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
|
+
["-y", "--loglevel=error", "skills", "add", "commet-labs/commet-skills"],
|
|
446
|
+
{ cwd: projectRoot },
|
|
447
|
+
(error) => {
|
|
448
|
+
if (error) {
|
|
449
|
+
console.log(import_chalk3.default.dim(" You can install them manually by running:"));
|
|
450
|
+
console.log(import_chalk3.default.dim(" npx skills add commet-labs/commet-skills"));
|
|
451
|
+
}
|
|
452
|
+
resolve3();
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
428
457
|
var createCommand = new import_commander.Command("create").description("Create a new Commet app from a template").argument("[name]", "Project name").option(
|
|
429
458
|
"-t, --template <template>",
|
|
430
459
|
"Template to use (fixed, seats, metered, credits, balance-ai, balance-fixed)"
|
|
@@ -554,6 +583,7 @@ var createCommand = new import_commander.Command("create").description("Create a
|
|
|
554
583
|
console.log(import_chalk3.default.yellow("\n\u26A0 Cancelled"));
|
|
555
584
|
return;
|
|
556
585
|
}
|
|
586
|
+
const shouldInstallSkills = await askSkills();
|
|
557
587
|
const downloadSpinner = (0, import_ora2.default)("Downloading template...").start();
|
|
558
588
|
try {
|
|
559
589
|
await downloadTemplate(template.dir, dest, opts.ref);
|
|
@@ -603,6 +633,11 @@ var createCommand = new import_commander.Command("create").description("Create a
|
|
|
603
633
|
keySpinner.succeed("API key created and saved to .env");
|
|
604
634
|
}
|
|
605
635
|
linkProject(dest, selectedOrg.id, selectedOrg.name, auth.environment);
|
|
636
|
+
if (shouldInstallSkills) {
|
|
637
|
+
const skillsSpinner = (0, import_ora2.default)("Installing agent skills...").start();
|
|
638
|
+
await installSkills(dest);
|
|
639
|
+
skillsSpinner.succeed("Agent skills installed");
|
|
640
|
+
}
|
|
606
641
|
console.log(import_chalk3.default.green(`
|
|
607
642
|
\u2713 Created ${projectName}`));
|
|
608
643
|
console.log(import_chalk3.default.dim(` Template: ${template.name}`));
|