@rely-ai/caliber 1.10.1 → 1.11.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/bin.js +64 -16
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -5825,6 +5825,9 @@ function formatMs(ms) {
5825
5825
  }
5826
5826
 
5827
5827
  // src/commands/init.ts
5828
+ function log(verbose, ...args) {
5829
+ if (verbose) console.log(chalk8.dim(` [verbose] ${args.map(String).join(" ")}`));
5830
+ }
5828
5831
  async function initCommand(options) {
5829
5832
  const brand = chalk8.hex("#EB9D83");
5830
5833
  const title = chalk8.hex("#83D1EB");
@@ -5884,6 +5887,10 @@ async function initCommand(options) {
5884
5887
  const spinner = ora2("Analyzing project...").start();
5885
5888
  const fingerprint = await collectFingerprint(process.cwd());
5886
5889
  spinner.succeed("Project analyzed");
5890
+ log(options.verbose, `Fingerprint: ${fingerprint.languages.length} languages, ${fingerprint.frameworks.length} frameworks, ${fingerprint.fileTree.length} files`);
5891
+ if (options.verbose && fingerprint.codeAnalysis) {
5892
+ log(options.verbose, `Code analysis: ${fingerprint.codeAnalysis.fileSummaries.length} file summaries, ${fingerprint.codeAnalysis.configFiles.length} config files`);
5893
+ }
5887
5894
  trackInitProjectDiscovered(fingerprint.languages.length, fingerprint.frameworks.length, fingerprint.fileTree.length);
5888
5895
  console.log(chalk8.dim(` Languages: ${fingerprint.languages.join(", ") || "none detected"}`));
5889
5896
  console.log(chalk8.dim(` Files: ${fingerprint.fileTree.length} found
@@ -5898,7 +5905,15 @@ async function initCommand(options) {
5898
5905
  report.addJson("Fingerprint: Code Analysis", fingerprint.codeAnalysis);
5899
5906
  }
5900
5907
  }
5901
- const targetAgent = options.agent || await promptAgent();
5908
+ let targetAgent;
5909
+ if (options.agent) {
5910
+ targetAgent = options.agent;
5911
+ } else if (options.autoApprove) {
5912
+ targetAgent = ["claude"];
5913
+ log(options.verbose, "Auto-approve: defaulting to claude agent");
5914
+ } else {
5915
+ targetAgent = await promptAgent();
5916
+ }
5902
5917
  trackInitAgentSelected(targetAgent);
5903
5918
  const preScore = computeLocalScore(process.cwd(), targetAgent);
5904
5919
  const failingForDismissal = preScore.checks.filter((c) => !c.passed && c.maxPoints > 0);
@@ -5913,6 +5928,11 @@ async function initCommand(options) {
5913
5928
  }
5914
5929
  const baselineScore = computeLocalScore(process.cwd(), targetAgent);
5915
5930
  displayScoreSummary(baselineScore);
5931
+ if (options.verbose) {
5932
+ for (const c of baselineScore.checks) {
5933
+ log(options.verbose, ` ${c.passed ? "\u2713" : "\u2717"} ${c.name}: ${c.earnedPoints}/${c.maxPoints}${c.suggestion ? ` \u2014 ${c.suggestion}` : ""}`);
5934
+ }
5935
+ }
5916
5936
  const passingCount = baselineScore.checks.filter((c) => c.passed).length;
5917
5937
  const failingCount = baselineScore.checks.filter((c) => !c.passed).length;
5918
5938
  if (report) {
@@ -6050,6 +6070,7 @@ async function initCommand(options) {
6050
6070
  const secs = Math.floor(elapsedMs % 6e4 / 1e3);
6051
6071
  const timeStr = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
6052
6072
  genSpinner.succeed(`Setup generated ${chalk8.dim(`in ${timeStr}`)}`);
6073
+ log(options.verbose, `Generation completed: ${elapsedMs}ms, stopReason: ${genStopReason || "end_turn"}`);
6053
6074
  printSetupSummary(generatedSetup);
6054
6075
  const sessionHistory = [];
6055
6076
  sessionHistory.push({
@@ -6067,6 +6088,10 @@ async function initCommand(options) {
6067
6088
  console.log(chalk8.dim(" No changes needed \u2014 your configs are already up to date.\n"));
6068
6089
  cleanupStaging();
6069
6090
  action = "accept";
6091
+ } else if (options.autoApprove) {
6092
+ log(options.verbose, "Auto-approve: accepting changes without review");
6093
+ action = "accept";
6094
+ trackInitReviewAction(action, "auto-approved");
6070
6095
  } else {
6071
6096
  const wantsReview = await promptWantsReview();
6072
6097
  if (wantsReview) {
@@ -6144,7 +6169,13 @@ async function initCommand(options) {
6144
6169
  console.log("");
6145
6170
  console.log(title.bold(" Keep your setup up-to-date as your code evolve\n"));
6146
6171
  console.log(chalk8.dim(" Caliber can automatically update your agent configs when your code changes.\n"));
6147
- const hookChoice = await promptHookType(targetAgent);
6172
+ let hookChoice;
6173
+ if (options.autoApprove) {
6174
+ hookChoice = "skip";
6175
+ log(options.verbose, "Auto-approve: skipping hook installation");
6176
+ } else {
6177
+ hookChoice = await promptHookType(targetAgent);
6178
+ }
6148
6179
  trackInitHookSelected(hookChoice);
6149
6180
  if (hookChoice === "claude" || hookChoice === "both") {
6150
6181
  const hookResult = installHook();
@@ -6182,6 +6213,11 @@ async function initCommand(options) {
6182
6213
  if (polishFailingChecks.length > 0) {
6183
6214
  console.log("");
6184
6215
  console.log(chalk8.dim(` Score: ${afterScore.score}/100 \u2014 polishing ${polishFailingChecks.length} remaining check${polishFailingChecks.length === 1 ? "" : "s"}...`));
6216
+ if (options.verbose) {
6217
+ for (const c of polishFailingChecks) {
6218
+ log(options.verbose, ` Polish target: ${c.name}${c.suggestion ? ` \u2014 ${c.suggestion}` : ""}`);
6219
+ }
6220
+ }
6185
6221
  const polishFailing = polishFailingChecks.map((c) => ({
6186
6222
  name: c.name,
6187
6223
  suggestion: c.suggestion
@@ -6238,15 +6274,27 @@ async function initCommand(options) {
6238
6274
  ` + afterScore.checks.map((c) => `| ${c.name} | ${c.passed ? "Yes" : "No"} | ${c.earnedPoints} | ${c.maxPoints} |`).join("\n"));
6239
6275
  }
6240
6276
  displayScoreDelta(baselineScore, afterScore);
6277
+ if (options.verbose) {
6278
+ log(options.verbose, `Final score: ${afterScore.score}/100`);
6279
+ for (const c of afterScore.checks.filter((ch) => !ch.passed)) {
6280
+ log(options.verbose, ` Still failing: ${c.name} (${c.earnedPoints}/${c.maxPoints})${c.suggestion ? ` \u2014 ${c.suggestion}` : ""}`);
6281
+ }
6282
+ }
6241
6283
  console.log(title.bold("\n Step 6/6 \u2014 Community skills\n"));
6242
6284
  console.log(chalk8.dim(" Search public skill registries for skills that match your tech stack.\n"));
6243
- const wantsSkills = await select5({
6244
- message: "Search public repos for relevant skills to add to this project?",
6245
- choices: [
6246
- { name: "Yes, find skills for my project", value: true },
6247
- { name: "Skip for now", value: false }
6248
- ]
6249
- });
6285
+ let wantsSkills;
6286
+ if (options.autoApprove) {
6287
+ wantsSkills = false;
6288
+ log(options.verbose, "Auto-approve: skipping skills search");
6289
+ } else {
6290
+ wantsSkills = await select5({
6291
+ message: "Search public repos for relevant skills to add to this project?",
6292
+ choices: [
6293
+ { name: "Yes, find skills for my project", value: true },
6294
+ { name: "Skip for now", value: false }
6295
+ ]
6296
+ });
6297
+ }
6250
6298
  if (wantsSkills) {
6251
6299
  trackInitSkillsSearch(true, 0);
6252
6300
  try {
@@ -7013,7 +7061,7 @@ Changed files: ${diff.changedFiles.join(", ")}`);
7013
7061
 
7014
7062
  // src/commands/refresh.ts
7015
7063
  init_config();
7016
- function log(quiet, ...args) {
7064
+ function log2(quiet, ...args) {
7017
7065
  if (!quiet) console.log(...args);
7018
7066
  }
7019
7067
  function discoverGitRepos(parentDir) {
@@ -7042,7 +7090,7 @@ async function refreshSingleRepo(repoDir, options) {
7042
7090
  if (currentSha) {
7043
7091
  writeState({ lastRefreshSha: currentSha, lastRefreshTimestamp: (/* @__PURE__ */ new Date()).toISOString() });
7044
7092
  }
7045
- log(quiet, chalk13.dim(`${prefix}No changes since last refresh.`));
7093
+ log2(quiet, chalk13.dim(`${prefix}No changes since last refresh.`));
7046
7094
  return;
7047
7095
  }
7048
7096
  const spinner = quiet ? null : ora5(`${prefix}Analyzing changes...`).start();
@@ -7086,10 +7134,10 @@ async function refreshSingleRepo(repoDir, options) {
7086
7134
  trackRefreshCompleted(written.length, Date.now());
7087
7135
  spinner?.succeed(`${prefix}Updated ${written.length} doc${written.length === 1 ? "" : "s"}`);
7088
7136
  for (const file of written) {
7089
- log(quiet, ` ${chalk13.green("\u2713")} ${file}`);
7137
+ log2(quiet, ` ${chalk13.green("\u2713")} ${file}`);
7090
7138
  }
7091
7139
  if (response.changesSummary) {
7092
- log(quiet, chalk13.dim(`
7140
+ log2(quiet, chalk13.dim(`
7093
7141
  ${response.changesSummary}`));
7094
7142
  }
7095
7143
  if (currentSha) {
@@ -7116,7 +7164,7 @@ async function refreshCommand(options) {
7116
7164
  console.log(chalk13.red("Not inside a git repository and no git repos found in child directories."));
7117
7165
  throw new Error("__exit__");
7118
7166
  }
7119
- log(quiet, chalk13.dim(`Found ${repos.length} git repo${repos.length === 1 ? "" : "s"}
7167
+ log2(quiet, chalk13.dim(`Found ${repos.length} git repo${repos.length === 1 ? "" : "s"}
7120
7168
  `));
7121
7169
  const originalDir = process.cwd();
7122
7170
  for (const repo of repos) {
@@ -7126,7 +7174,7 @@ async function refreshCommand(options) {
7126
7174
  await refreshSingleRepo(repo, { ...options, label: repoName });
7127
7175
  } catch (err) {
7128
7176
  if (err instanceof Error && err.message === "__exit__") continue;
7129
- log(quiet, chalk13.yellow(`${repoName}: refresh failed \u2014 ${err instanceof Error ? err.message : "unknown error"}`));
7177
+ log2(quiet, chalk13.yellow(`${repoName}: refresh failed \u2014 ${err instanceof Error ? err.message : "unknown error"}`));
7130
7178
  }
7131
7179
  }
7132
7180
  process.chdir(originalDir);
@@ -7753,7 +7801,7 @@ function parseAgentOption(value) {
7753
7801
  }
7754
7802
  return agents;
7755
7803
  }
7756
- program.command("init").description("Initialize your project for AI-assisted development").option("--agent <type>", "Target agents (comma-separated): claude, cursor, codex", parseAgentOption).option("--dry-run", "Preview changes without writing files").option("--force", "Overwrite existing setup without prompting").option("--debug-report", void 0, false).option("--show-tokens", "Show token usage summary at the end").action(tracked("init", initCommand));
7804
+ program.command("init").description("Initialize your project for AI-assisted development").option("--agent <type>", "Target agents (comma-separated): claude, cursor, codex", parseAgentOption).option("--dry-run", "Preview changes without writing files").option("--force", "Overwrite existing setup without prompting").option("--debug-report", void 0, false).option("--show-tokens", "Show token usage summary at the end").option("--auto-approve", "Run without interactive prompts (auto-accept all)").option("--verbose", "Show detailed logs of each step").action(tracked("init", initCommand));
7757
7805
  program.command("undo").description("Revert all config changes made by Caliber").action(tracked("undo", undoCommand));
7758
7806
  program.command("status").description("Show current Caliber setup status").option("--json", "Output as JSON").action(tracked("status", statusCommand));
7759
7807
  program.command("regenerate").alias("regen").alias("re").description("Re-analyze project and regenerate setup").option("--dry-run", "Preview changes without writing files").action(tracked("regenerate", regenerateCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "Analyze your codebase and generate optimized AI agent configs (CLAUDE.md, .cursorrules, skills) — no API key needed",
5
5
  "type": "module",
6
6
  "bin": {