@insforge/cli 0.1.73 → 0.1.74

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
@@ -1751,10 +1751,14 @@ ${missing.join("\n")}
1751
1751
  `;
1752
1752
  appendFileSync(gitignorePath, block);
1753
1753
  }
1754
- async function installSkills(json) {
1754
+ var AGENT_FLAGS = "-a antigravity -a augment -a claude-code -a cline -a codex -a cursor -a gemini-cli -a github-copilot -a kilo -a qoder -a qwen-code -a roo -a trae -a windsurf";
1755
+ var PROVIDER_SKILLS = {
1756
+ "better-auth": { repo: "better-auth/skills", label: "Better Auth skills" }
1757
+ };
1758
+ async function installSkills(json, authProvider) {
1755
1759
  try {
1756
1760
  if (!json) clack9.log.info("Installing InsForge agent skills (global)...");
1757
- await execAsync("npx skills add insforge/agent-skills -g -y -a antigravity -a augment -a claude-code -a cline -a codex -a cursor -a gemini-cli -a github-copilot -a kilo -a qoder -a qwen-code -a roo -a trae -a windsurf", {
1761
+ await execAsync(`npx skills add insforge/agent-skills -g -y ${AGENT_FLAGS}`, {
1758
1762
  cwd: process.cwd(),
1759
1763
  timeout: SKILL_INSTALL_TIMEOUT_MS
1760
1764
  });
@@ -1778,6 +1782,22 @@ async function installSkills(json) {
1778
1782
  clack9.log.info("Run `npx skills add https://github.com/vercel-labs/skills --skill find-skills` once resolved.");
1779
1783
  }
1780
1784
  }
1785
+ const providerEntry = authProvider ? PROVIDER_SKILLS[authProvider] : void 0;
1786
+ if (providerEntry) {
1787
+ try {
1788
+ if (!json) clack9.log.info(`Installing ${providerEntry.label} (global)...`);
1789
+ await execAsync(`npx skills add ${providerEntry.repo} -g -y ${AGENT_FLAGS}`, {
1790
+ cwd: process.cwd(),
1791
+ timeout: SKILL_INSTALL_TIMEOUT_MS
1792
+ });
1793
+ if (!json) clack9.log.success(`${providerEntry.label} installed.`);
1794
+ } catch (err) {
1795
+ if (!json) {
1796
+ clack9.log.warn(`Could not install ${providerEntry.label}: ${describeExecError(err)}`);
1797
+ clack9.log.info(`Run \`npx skills add ${providerEntry.repo}\` once resolved to see the full output.`);
1798
+ }
1799
+ }
1800
+ }
1781
1801
  try {
1782
1802
  updateGitignore();
1783
1803
  } catch {
@@ -2877,7 +2897,7 @@ function registerCreateCommand(program2) {
2877
2897
  else clack12.log.warn(msg);
2878
2898
  }
2879
2899
  }
2880
- await installSkills(json);
2900
+ await installSkills(json, opts.auth);
2881
2901
  trackCommand("create", orgId);
2882
2902
  await reportCliUsage("cli.create", true, 6);
2883
2903
  const templateDownloaded = hasTemplate ? await fs4.stat(path4.join(process.cwd(), "package.json")).catch(() => null) : null;
@@ -3147,7 +3167,7 @@ async function runNpmSetupIfPresent() {
3147
3167
  }
3148
3168
  }
3149
3169
  function registerProjectLinkCommand(program2) {
3150
- program2.command("link").description("Link current directory to an InsForge project").option("--project-id <id>", "Project ID to link").option("--org-id <id>", "Organization ID").option("--template <template>", "Download a template after linking: react, nextjs, chatbot, crm, e-commerce, todo").option("--auth <provider>", "Wire a third-party auth provider into the chosen template (currently: better-auth)").option("--api-base-url <url>", "API Base URL for direct linking (OSS/Self-hosted)").option("--api-key <key>", "API Key for direct linking (OSS/Self-hosted)").action(async (opts, cmd) => {
3170
+ program2.command("link").description("Link current directory to an InsForge project (no args: installs agent skills only)").option("--project-id <id>", "Project ID to link").option("--org-id <id>", "Organization ID").option("--template <template>", "Download a template after linking: react, nextjs, chatbot, crm, e-commerce, todo").option("--auth <provider>", "Wire a third-party auth provider into the chosen template (currently: better-auth)").option("--api-base-url <url>", "API Base URL for direct linking (OSS/Self-hosted)").option("--api-key <key>", "API Key for direct linking (OSS/Self-hosted)").action(async (opts, cmd) => {
3151
3171
  const { json, apiUrl } = getRootOpts(cmd);
3152
3172
  const validTemplates = ["react", "nextjs", "chatbot", "crm", "e-commerce", "todo"];
3153
3173
  if (opts.auth && !VALID_AUTH_PROVIDERS.includes(opts.auth)) {
@@ -3157,6 +3177,28 @@ function registerProjectLinkCommand(program2) {
3157
3177
  if (opts.template && !validTemplates.includes(opts.template)) {
3158
3178
  throw new CLIError(`Invalid template "${opts.template}". Valid options: ${validTemplates.join(", ")}`);
3159
3179
  }
3180
+ const isSkillsOnly = opts.projectId === void 0 && opts.orgId === void 0 && opts.template === void 0 && opts.auth === void 0 && opts.apiBaseUrl === void 0 && opts.apiKey === void 0;
3181
+ if (isSkillsOnly) {
3182
+ try {
3183
+ await installSkills(json);
3184
+ trackCommand("link", "skills-only", { skills_only: true });
3185
+ await reportCliUsage("cli.link_skills_only", true, 1);
3186
+ if (json) {
3187
+ outputJson({ success: true, skills_only: true });
3188
+ } else {
3189
+ clack13.note(
3190
+ `Open your coding agent (Claude Code, Codex, Cursor, etc.) and ask it to build something. It will walk you through provisioning an InsForge project when needed.`,
3191
+ "What's next"
3192
+ );
3193
+ }
3194
+ return;
3195
+ } catch (err) {
3196
+ await reportCliUsage("cli.link_skills_only", false);
3197
+ await shutdownAnalytics();
3198
+ handleError(err, json);
3199
+ return;
3200
+ }
3201
+ }
3160
3202
  if (opts.apiBaseUrl || opts.apiKey) {
3161
3203
  try {
3162
3204
  if (!opts.apiBaseUrl || !opts.apiKey) {
@@ -3235,7 +3277,7 @@ function registerProjectLinkCommand(program2) {
3235
3277
  await runNpmSetupIfPresent();
3236
3278
  }
3237
3279
  }
3238
- await installSkills(json);
3280
+ await installSkills(json, opts.auth);
3239
3281
  trackCommand("link", "oss-org", { direct: true, template: template2 });
3240
3282
  await reportCliUsage("cli.link_direct", true, 6, projectConfig2);
3241
3283
  try {
@@ -3282,7 +3324,7 @@ function registerProjectLinkCommand(program2) {
3282
3324
  }
3283
3325
  }
3284
3326
  trackCommand("link", "oss-org", { direct: true });
3285
- await installSkills(json);
3327
+ await installSkills(json, opts.auth);
3286
3328
  await reportCliUsage("cli.link_direct", true, 6, projectConfig2);
3287
3329
  try {
3288
3330
  const urlMatch = opts.apiBaseUrl.match(/^https?:\/\/([^.]+)\.[^.]+\.insforge\.app/);
@@ -3432,7 +3474,7 @@ function registerProjectLinkCommand(program2) {
3432
3474
  await runNpmSetupIfPresent();
3433
3475
  }
3434
3476
  }
3435
- await installSkills(json);
3477
+ await installSkills(json, opts.auth);
3436
3478
  await reportCliUsage("cli.link", true, 6, projectConfig);
3437
3479
  if (!json) {
3438
3480
  const dashboardUrl = `${getFrontendUrl()}/dashboard/project/${project.id}`;
@@ -3465,7 +3507,7 @@ function registerProjectLinkCommand(program2) {
3465
3507
  else clack13.log.warn(msg);
3466
3508
  }
3467
3509
  }
3468
- await installSkills(json);
3510
+ await installSkills(json, opts.auth);
3469
3511
  await reportCliUsage("cli.link", true, 6, projectConfig);
3470
3512
  if (!json) {
3471
3513
  const dashboardUrl = `${getFrontendUrl()}/dashboard/project/${project.id}`;
@@ -6896,7 +6938,7 @@ function registerDiagnoseCommands(diagnoseCmd2) {
6896
6938
  const s = !json ? clack15.spinner() : null;
6897
6939
  s?.start("Collecting diagnostic data...");
6898
6940
  const data2 = await collectDiagnosticData(projectId, ossMode, apiUrl);
6899
- const cliVersion = "0.1.73";
6941
+ const cliVersion = "0.1.74";
6900
6942
  s?.stop("Data collected");
6901
6943
  if (!json) {
6902
6944
  console.log(`