@insforge/cli 0.1.72 → 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 {
@@ -1952,6 +1972,7 @@ function extractEnvPairs(content) {
1952
1972
  }
1953
1973
  return out;
1954
1974
  }
1975
+ var MASKED_PASSWORD_PATTERN = /:\*+@/;
1955
1976
  function refreshStaleEnvDefaults(existing, manifestDefaults, platformValues) {
1956
1977
  const refreshed = [];
1957
1978
  const lines = existing.split("\n").map((line) => {
@@ -1961,7 +1982,10 @@ function refreshStaleEnvDefaults(existing, manifestDefaults, platformValues) {
1961
1982
  const userValue = m[2];
1962
1983
  const def = manifestDefaults.get(key);
1963
1984
  const real = platformValues.get(key);
1964
- if (def !== void 0 && real !== void 0 && userValue === def && real !== def) {
1985
+ if (def === void 0 || real === void 0 || real === def) return line;
1986
+ const matchesDefault = userValue === def;
1987
+ const isMaskedPassword = MASKED_PASSWORD_PATTERN.test(userValue);
1988
+ if (matchesDefault || isMaskedPassword) {
1965
1989
  refreshed.push(key);
1966
1990
  return `${key}=${real}`;
1967
1991
  }
@@ -2873,7 +2897,7 @@ function registerCreateCommand(program2) {
2873
2897
  else clack12.log.warn(msg);
2874
2898
  }
2875
2899
  }
2876
- await installSkills(json);
2900
+ await installSkills(json, opts.auth);
2877
2901
  trackCommand("create", orgId);
2878
2902
  await reportCliUsage("cli.create", true, 6);
2879
2903
  const templateDownloaded = hasTemplate ? await fs4.stat(path4.join(process.cwd(), "package.json")).catch(() => null) : null;
@@ -3143,7 +3167,7 @@ async function runNpmSetupIfPresent() {
3143
3167
  }
3144
3168
  }
3145
3169
  function registerProjectLinkCommand(program2) {
3146
- 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) => {
3147
3171
  const { json, apiUrl } = getRootOpts(cmd);
3148
3172
  const validTemplates = ["react", "nextjs", "chatbot", "crm", "e-commerce", "todo"];
3149
3173
  if (opts.auth && !VALID_AUTH_PROVIDERS.includes(opts.auth)) {
@@ -3153,6 +3177,28 @@ function registerProjectLinkCommand(program2) {
3153
3177
  if (opts.template && !validTemplates.includes(opts.template)) {
3154
3178
  throw new CLIError(`Invalid template "${opts.template}". Valid options: ${validTemplates.join(", ")}`);
3155
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
+ }
3156
3202
  if (opts.apiBaseUrl || opts.apiKey) {
3157
3203
  try {
3158
3204
  if (!opts.apiBaseUrl || !opts.apiKey) {
@@ -3231,7 +3277,7 @@ function registerProjectLinkCommand(program2) {
3231
3277
  await runNpmSetupIfPresent();
3232
3278
  }
3233
3279
  }
3234
- await installSkills(json);
3280
+ await installSkills(json, opts.auth);
3235
3281
  trackCommand("link", "oss-org", { direct: true, template: template2 });
3236
3282
  await reportCliUsage("cli.link_direct", true, 6, projectConfig2);
3237
3283
  try {
@@ -3278,7 +3324,7 @@ function registerProjectLinkCommand(program2) {
3278
3324
  }
3279
3325
  }
3280
3326
  trackCommand("link", "oss-org", { direct: true });
3281
- await installSkills(json);
3327
+ await installSkills(json, opts.auth);
3282
3328
  await reportCliUsage("cli.link_direct", true, 6, projectConfig2);
3283
3329
  try {
3284
3330
  const urlMatch = opts.apiBaseUrl.match(/^https?:\/\/([^.]+)\.[^.]+\.insforge\.app/);
@@ -3428,7 +3474,7 @@ function registerProjectLinkCommand(program2) {
3428
3474
  await runNpmSetupIfPresent();
3429
3475
  }
3430
3476
  }
3431
- await installSkills(json);
3477
+ await installSkills(json, opts.auth);
3432
3478
  await reportCliUsage("cli.link", true, 6, projectConfig);
3433
3479
  if (!json) {
3434
3480
  const dashboardUrl = `${getFrontendUrl()}/dashboard/project/${project.id}`;
@@ -3461,7 +3507,7 @@ function registerProjectLinkCommand(program2) {
3461
3507
  else clack13.log.warn(msg);
3462
3508
  }
3463
3509
  }
3464
- await installSkills(json);
3510
+ await installSkills(json, opts.auth);
3465
3511
  await reportCliUsage("cli.link", true, 6, projectConfig);
3466
3512
  if (!json) {
3467
3513
  const dashboardUrl = `${getFrontendUrl()}/dashboard/project/${project.id}`;
@@ -6892,7 +6938,7 @@ function registerDiagnoseCommands(diagnoseCmd2) {
6892
6938
  const s = !json ? clack15.spinner() : null;
6893
6939
  s?.start("Collecting diagnostic data...");
6894
6940
  const data2 = await collectDiagnosticData(projectId, ossMode, apiUrl);
6895
- const cliVersion = "0.1.72";
6941
+ const cliVersion = "0.1.74";
6896
6942
  s?.stop("Data collected");
6897
6943
  if (!json) {
6898
6944
  console.log(`