yingclaw 2.4.1 → 2.4.2
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/bin/cli.js +23 -7
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ const pkg = require('../package.json');
|
|
|
25
25
|
const { buildMenuStatusLines, buildStatusView } = require('../lib/panel');
|
|
26
26
|
const { buildClaudeInstallCommand } = require('../lib/install');
|
|
27
27
|
const { clearClaudeDesktopConfig, isDesktopConfigured, openClaudeDesktop, writeClaudeDesktopConfig } = require('../lib/desktop');
|
|
28
|
-
const { runDoctorChecks, summarize, STATUS_OK, STATUS_FAIL, STATUS_WARN, STATUS_INFO } = require('../lib/doctor');
|
|
28
|
+
const { runDoctorChecks, summarize, checkShellRcBlock, STATUS_OK, STATUS_FAIL, STATUS_WARN, STATUS_INFO } = require('../lib/doctor');
|
|
29
29
|
|
|
30
30
|
const program = new Command();
|
|
31
31
|
|
|
@@ -684,6 +684,10 @@ program
|
|
|
684
684
|
const spinner = ora('清除中...').start();
|
|
685
685
|
setSystemPrompt(config, null);
|
|
686
686
|
saveConfig(config);
|
|
687
|
+
const rcBlockOnClear = checkShellRcBlock();
|
|
688
|
+
if (rcBlockOnClear.found) {
|
|
689
|
+
writeEnvToZshrc(config.baseUrl, config.apiKey, config.model, config.fastModel, {});
|
|
690
|
+
}
|
|
687
691
|
spinner.succeed(chalk.green('系统提示词已清除'));
|
|
688
692
|
return;
|
|
689
693
|
}
|
|
@@ -706,13 +710,25 @@ program
|
|
|
706
710
|
const spinner = ora('保存中...').start();
|
|
707
711
|
setSystemPrompt(config, newPrompt);
|
|
708
712
|
saveConfig(config);
|
|
709
|
-
spinner.succeed(chalk.green('系统提示词已保存'));
|
|
710
713
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
714
|
+
// 如果终端已配置,自动同步 shell RC
|
|
715
|
+
const rcBlock = checkShellRcBlock();
|
|
716
|
+
if (rcBlock.found) {
|
|
717
|
+
writeEnvToZshrc(config.baseUrl, config.apiKey, config.model, config.fastModel, { systemPrompt: getSystemPrompt(config) });
|
|
718
|
+
spinner.succeed(chalk.green('系统提示词已保存,已同步到终端配置'));
|
|
719
|
+
console.log(boxen(
|
|
720
|
+
chalk.dim('• 通过菜单"启动 Claude Code"立即生效\n') +
|
|
721
|
+
chalk.dim('• 终端直接运行 claude 需先执行:') + chalk.cyan(`source ${rcBlock.file}`),
|
|
722
|
+
{ padding: { top: 0, bottom: 0, left: 2, right: 2 }, borderStyle: 'round', borderColor: 'green', margin: { top: 1, bottom: 1 } }
|
|
723
|
+
));
|
|
724
|
+
} else {
|
|
725
|
+
spinner.succeed(chalk.green('系统提示词已保存'));
|
|
726
|
+
console.log(boxen(
|
|
727
|
+
chalk.dim('• 通过菜单"启动 Claude Code"时自动应用\n') +
|
|
728
|
+
chalk.dim('• 终端直接使用 claude 命令请重新运行 ') + chalk.cyan('claw code'),
|
|
729
|
+
{ padding: { top: 0, bottom: 0, left: 2, right: 2 }, borderStyle: 'round', borderColor: 'green', margin: { top: 1, bottom: 1 } }
|
|
730
|
+
));
|
|
731
|
+
}
|
|
716
732
|
});
|
|
717
733
|
|
|
718
734
|
program
|