coding-friend-cli 1.23.0 → 1.25.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-
|
|
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-
|
|
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) => {
|
|
@@ -61,7 +61,7 @@ program.command("update").description("Update coding-friend plugin, CLI, and sta
|
|
|
61
61
|
await updateCommand(opts);
|
|
62
62
|
});
|
|
63
63
|
program.command("status").description("Show comprehensive Coding Friend status").action(async () => {
|
|
64
|
-
const { statusCommand } = await import("./status-
|
|
64
|
+
const { statusCommand } = await import("./status-FRIGREUV.js");
|
|
65
65
|
await statusCommand();
|
|
66
66
|
});
|
|
67
67
|
var session = program.command("session").description("Save and load Claude Code sessions across machines");
|
|
@@ -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`;
|
|
@@ -90,7 +90,7 @@ function printConfig(obj, otherConfig) {
|
|
|
90
90
|
const names = subVal.map(
|
|
91
91
|
(c) => typeof c === "object" && c !== null && "name" in c ? c.name : String(c)
|
|
92
92
|
).join(", ");
|
|
93
|
-
subLine(subKey, names, subOverrides, chalk.
|
|
93
|
+
subLine(subKey, names, subOverrides, chalk.blueBright);
|
|
94
94
|
continue;
|
|
95
95
|
}
|
|
96
96
|
if (typeof subVal === "object" && subVal !== null && !Array.isArray(subVal)) {
|
|
@@ -98,7 +98,7 @@ function printConfig(obj, otherConfig) {
|
|
|
98
98
|
subVal
|
|
99
99
|
);
|
|
100
100
|
const inline = innerEntries.map(([k, v]) => `${k}: ${formatScalar(v)}`).join(", ");
|
|
101
|
-
subLine(subKey, inline, subOverrides, chalk.
|
|
101
|
+
subLine(subKey, inline, subOverrides, chalk.blueBright);
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
104
|
if (Array.isArray(subVal)) {
|
|
@@ -106,11 +106,11 @@ function printConfig(obj, otherConfig) {
|
|
|
106
106
|
subKey,
|
|
107
107
|
subVal.map((v) => formatScalar(v)).join(", "),
|
|
108
108
|
subOverrides,
|
|
109
|
-
chalk.
|
|
109
|
+
chalk.blueBright
|
|
110
110
|
);
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
|
-
subLine(subKey, formatScalar(subVal), subOverrides, chalk.
|
|
113
|
+
subLine(subKey, formatScalar(subVal), subOverrides, chalk.blueBright);
|
|
114
114
|
}
|
|
115
115
|
continue;
|
|
116
116
|
}
|
|
@@ -135,6 +135,7 @@ function versionLine(label, current, latest) {
|
|
|
135
135
|
return `${padded}${current} \u2192 ${latest} ${indicator}`;
|
|
136
136
|
}
|
|
137
137
|
async function statusCommand() {
|
|
138
|
+
console.log(chalk.dim("Loading status information\u2026"));
|
|
138
139
|
const pluginVersion = getInstalledVersion();
|
|
139
140
|
const latestPlugin = getLatestVersion();
|
|
140
141
|
const cliVersion = getCliVersion();
|