@insforge/cli 0.1.18 → 0.1.19

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 CHANGED
@@ -694,6 +694,21 @@ ${missing.join("\n")}
694
694
  `;
695
695
  appendFileSync(gitignorePath, block);
696
696
  }
697
+ async function installCliGlobally(json) {
698
+ try {
699
+ const { stdout } = await execAsync("npm ls -g @insforge/cli --json", { timeout: 1e4 });
700
+ const parsed = JSON.parse(stdout);
701
+ if (parsed?.dependencies?.["@insforge/cli"]) return;
702
+ } catch {
703
+ }
704
+ try {
705
+ if (!json) clack5.log.info("Installing InsForge CLI globally...");
706
+ await execAsync("npm install -g @insforge/cli", { timeout: 6e4 });
707
+ if (!json) clack5.log.success("InsForge CLI installed. You can now run `insforge` directly.");
708
+ } catch {
709
+ if (!json) clack5.log.warn("Failed to install CLI globally. You can run manually: npm install -g @insforge/cli");
710
+ }
711
+ }
697
712
  async function installSkills(json) {
698
713
  try {
699
714
  if (!json) clack5.log.info("Installing InsForge agent skills...");
@@ -818,6 +833,7 @@ function registerProjectLinkCommand(program2) {
818
833
  } else {
819
834
  outputSuccess(`Linked to project "${project.name}" (${project.appkey}.${project.region})`);
820
835
  }
836
+ await installCliGlobally(json);
821
837
  await installSkills(json);
822
838
  await reportCliUsage("cli.link", true, 6);
823
839
  } catch (err) {
@@ -1969,6 +1985,7 @@ function registerCreateCommand(program2) {
1969
1985
  if (hasTemplate) {
1970
1986
  await downloadTemplate(template, projectConfig, projectName, json, apiUrl);
1971
1987
  }
1988
+ await installCliGlobally(json);
1972
1989
  await installSkills(json);
1973
1990
  await reportCliUsage("cli.create", true, 6);
1974
1991
  if (hasTemplate) {