coding-friend-cli 1.23.0 → 1.24.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.
@@ -379,6 +379,19 @@ async function learnSubMenu() {
379
379
  }
380
380
  }
381
381
  }
382
+ async function editAutoApprove(globalCfg, localCfg) {
383
+ const currentValue = getMergedValue("autoApprove", globalCfg, localCfg);
384
+ if (currentValue !== void 0) {
385
+ log.dim(`Current: ${currentValue}`);
386
+ }
387
+ const value = await confirm({
388
+ message: "Enable auto-approve? (auto-approves safe tool calls, blocks destructive ones, prompts for ambiguous)",
389
+ default: currentValue ?? false
390
+ });
391
+ const scope = await askScope();
392
+ if (scope === "back") return;
393
+ writeToScope(scope, { autoApprove: value });
394
+ }
382
395
  async function editStatusline() {
383
396
  const hookResult = findStatuslineHookPath();
384
397
  if (!hookResult) {
@@ -571,6 +584,12 @@ async function configCommand() {
571
584
  const langVal = getMergedValue("language", globalCfg, localCfg);
572
585
  const learnScope = getScopeLabel("learn", globalCfg, localCfg);
573
586
  const memoryScope = getScopeLabel("memory", globalCfg, localCfg);
587
+ const autoApproveScope = getScopeLabel("autoApprove", globalCfg, localCfg);
588
+ const autoApproveVal = getMergedValue(
589
+ "autoApprove",
590
+ globalCfg,
591
+ localCfg
592
+ );
574
593
  const statuslineStatus = isStatuslineConfigured() ? chalk.green("configured") : chalk.yellow("not configured");
575
594
  const completionStatus = hasShellCompletion() ? chalk.green("installed") : chalk.yellow("not installed");
576
595
  const projectRules = getExistingRules(claudeLocalSettingsPath());
@@ -606,6 +625,11 @@ async function configCommand() {
606
625
  value: "memory",
607
626
  description: " Tier, auto-capture, auto-start, embedding provider, daemon timeout"
608
627
  },
628
+ {
629
+ name: `Auto-approve ${formatScopeLabel(autoApproveScope)}${autoApproveVal !== void 0 ? ` (${autoApproveVal})` : ""}`,
630
+ value: "autoApprove",
631
+ description: " Auto-approve safe tool calls, block destructive ones, prompt for ambiguous"
632
+ },
609
633
  {
610
634
  name: `Statusline (${statuslineStatus})`,
611
635
  value: "statusline",
@@ -646,6 +670,9 @@ async function configCommand() {
646
670
  case "memory":
647
671
  await memoryConfigMenu();
648
672
  break;
673
+ case "autoApprove":
674
+ await editAutoApprove(globalCfg, localCfg);
675
+ break;
649
676
  case "statusline":
650
677
  await editStatusline();
651
678
  break;
package/dist/index.js CHANGED
@@ -30,11 +30,11 @@ program.command("enable").description("Re-enable the Coding Friend plugin").opti
30
30
  await enableCommand(opts);
31
31
  });
32
32
  program.command("init").description("Initialize coding-friend in current project").action(async () => {
33
- const { initCommand } = await import("./init-6B2OHKFX.js");
33
+ const { initCommand } = await import("./init-UOKYZJ53.js");
34
34
  await initCommand();
35
35
  });
36
36
  program.command("config").description("Manage Coding Friend configuration").action(async () => {
37
- const { configCommand } = await import("./config-5DKOGWWJ.js");
37
+ const { configCommand } = await import("./config-6Z4XX5HW.js");
38
38
  await configCommand();
39
39
  });
40
40
  program.command("host").description("Build and serve learning docs as a static website").argument("[path]", "path to docs folder").option("-p, --port <port>", "port number", "3333").action(async (path, opts) => {
@@ -735,6 +735,12 @@ async function initMenu(gitAvailable) {
735
735
  const completionStatus = hasShellCompletion() ? chalk.green("installed") : chalk.yellow("not installed");
736
736
  const statuslineStatus = isStatuslineConfigured() ? chalk.green("configured") : chalk.yellow("not configured");
737
737
  const memoryStatus = getMemoryMcpStatus().configured ? chalk.green("configured") : chalk.yellow("not configured");
738
+ const autoApproveScope = getScopeLabel("autoApprove", globalCfg, localCfg);
739
+ const autoApproveVal = getMergedValue(
740
+ "autoApprove",
741
+ globalCfg,
742
+ localCfg
743
+ );
738
744
  const projectRules = getExistingRules(claudeLocalSettingsPath());
739
745
  const userRules = getExistingRules(claudeSettingsPath());
740
746
  const allRules = getAllRules();
@@ -781,6 +787,11 @@ async function initMenu(gitAvailable) {
781
787
  value: "memory",
782
788
  description: " Connect the memory system to Claude Code via MCP"
783
789
  },
790
+ {
791
+ name: `Auto-approve ${formatScopeLabel(autoApproveScope)}${autoApproveVal !== void 0 ? ` (${autoApproveVal})` : ""}`,
792
+ value: "autoApprove",
793
+ description: " Auto-approve safe tool calls, block destructive ones, prompt for ambiguous"
794
+ },
784
795
  {
785
796
  name: `Permissions (${permissionStatus} rules)`,
786
797
  value: "permissions",
@@ -818,6 +829,19 @@ async function initMenu(gitAvailable) {
818
829
  case "memory":
819
830
  await stepMemory(docsDir);
820
831
  break;
832
+ case "autoApprove": {
833
+ const autoApproveChoice = await confirm({
834
+ message: "Enable auto-approve? (auto-approves safe tool calls, blocks destructive ones, prompts for ambiguous)",
835
+ default: autoApproveVal ?? false
836
+ });
837
+ const autoApproveTargetScope = await askScope();
838
+ if (autoApproveTargetScope !== "back") {
839
+ const targetPath = autoApproveTargetScope === "global" ? globalConfigPath() : localConfigPath();
840
+ mergeJson(targetPath, { autoApprove: autoApproveChoice });
841
+ log.success(`Saved to ${targetPath}`);
842
+ }
843
+ break;
844
+ }
821
845
  case "permissions": {
822
846
  const learnCfg = localCfg?.learn ?? globalCfg?.learn;
823
847
  const learnOutputDir = learnCfg?.outputDir || `${docsDir}/learn`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-cli",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
5
  "type": "module",
6
6
  "bin": {