yingclaw 2.4.3 → 2.4.5
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 +18 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -237,6 +237,14 @@ async function showStatus() {
|
|
|
237
237
|
env: process.env,
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
+
const systemPromptText = getSystemPrompt(config);
|
|
241
|
+
if (systemPromptText) {
|
|
242
|
+
const preview = systemPromptText.length > 60 ? systemPromptText.slice(0, 60) + '…' : systemPromptText;
|
|
243
|
+
view.lines.push({ label: '系统提示词', value: preview });
|
|
244
|
+
} else {
|
|
245
|
+
view.lines.push({ label: '系统提示词', value: '未配置' });
|
|
246
|
+
}
|
|
247
|
+
|
|
240
248
|
const lines = view.lines.map(({ label, value }) => {
|
|
241
249
|
const coloredValue = label === '厂商'
|
|
242
250
|
? chalk.white.bold(value)
|
|
@@ -1193,13 +1201,17 @@ async function runMenu() {
|
|
|
1193
1201
|
if (resolvedAction === 'launch') {
|
|
1194
1202
|
const cfg = loadConfig();
|
|
1195
1203
|
if (!cfg || getConfigValidationMessage(cfg)) continue;
|
|
1196
|
-
const
|
|
1204
|
+
const systemPromptText = getSystemPrompt(cfg);
|
|
1205
|
+
const launchArgs = systemPromptText ? ['--append-system-prompt', systemPromptText] : [];
|
|
1206
|
+
if (systemPromptText) {
|
|
1207
|
+
const preview = systemPromptText.length > 40 ? systemPromptText.slice(0, 40) + '…' : systemPromptText;
|
|
1208
|
+
console.log(chalk.dim(` 系统提示词已启用:${preview}`));
|
|
1209
|
+
}
|
|
1197
1210
|
await new Promise((resolve) => {
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
env: { ...process.env, ...buildClaudeEnv(cfg) }
|
|
1201
|
-
|
|
1202
|
-
});
|
|
1211
|
+
// Windows 用显式 cmd.exe 调用,避免 shell:true 的参数拼接警告和转义问题
|
|
1212
|
+
const child = process.platform === 'win32'
|
|
1213
|
+
? spawn('cmd.exe', ['/d', '/c', 'claude', ...launchArgs], { stdio: 'inherit', env: { ...process.env, ...buildClaudeEnv(cfg) } })
|
|
1214
|
+
: spawn('claude', launchArgs, { stdio: 'inherit', env: { ...process.env, ...buildClaudeEnv(cfg) } });
|
|
1203
1215
|
child.on('error', () => {
|
|
1204
1216
|
console.log(chalk.yellow('\nClaude Code 未找到,请先选择"安装 Claude Code"'));
|
|
1205
1217
|
resolve();
|