ai-project-manage-cli 7.1.35 → 7.1.36

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/dist/index.js CHANGED
@@ -1349,10 +1349,24 @@ async function tryReadHttpsGitOriginUrl(cwd) {
1349
1349
  import { execFile as execFile2 } from "child_process";
1350
1350
  import { promisify as promisify2 } from "util";
1351
1351
  var execFileAsync2 = promisify2(execFile2);
1352
+ function gitExecEnv() {
1353
+ const existing = process.env.GIT_SSH_COMMAND?.trim();
1354
+ const acceptNew = "-o StrictHostKeyChecking=accept-new";
1355
+ let gitSshCommand;
1356
+ if (!existing) {
1357
+ gitSshCommand = `ssh ${acceptNew}`;
1358
+ } else if (/\bStrictHostKeyChecking=/.test(existing)) {
1359
+ gitSshCommand = existing;
1360
+ } else {
1361
+ gitSshCommand = `${existing} ${acceptNew}`;
1362
+ }
1363
+ return { ...process.env, GIT_SSH_COMMAND: gitSshCommand };
1364
+ }
1352
1365
  async function execGit(cwd, args, quiet = false) {
1353
1366
  try {
1354
1367
  const { stdout, stderr } = await execFileAsync2("git", args, {
1355
1368
  cwd,
1369
+ env: gitExecEnv(),
1356
1370
  encoding: "utf8",
1357
1371
  maxBuffer: 10 * 1024 * 1024
1358
1372
  });
@@ -395,10 +395,24 @@ async function tryReadHttpsGitOriginUrl(cwd) {
395
395
  import { execFile as execFile2 } from "child_process";
396
396
  import { promisify as promisify2 } from "util";
397
397
  var execFileAsync2 = promisify2(execFile2);
398
+ function gitExecEnv() {
399
+ const existing = process.env.GIT_SSH_COMMAND?.trim();
400
+ const acceptNew = "-o StrictHostKeyChecking=accept-new";
401
+ let gitSshCommand;
402
+ if (!existing) {
403
+ gitSshCommand = `ssh ${acceptNew}`;
404
+ } else if (/\bStrictHostKeyChecking=/.test(existing)) {
405
+ gitSshCommand = existing;
406
+ } else {
407
+ gitSshCommand = `${existing} ${acceptNew}`;
408
+ }
409
+ return { ...process.env, GIT_SSH_COMMAND: gitSshCommand };
410
+ }
398
411
  async function execGit(cwd, args, quiet = false) {
399
412
  try {
400
413
  const { stdout, stderr } = await execFileAsync2("git", args, {
401
414
  cwd,
415
+ env: gitExecEnv(),
402
416
  encoding: "utf8",
403
417
  maxBuffer: 10 * 1024 * 1024
404
418
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "7.1.35",
3
+ "version": "7.1.36",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,
@@ -15,7 +15,6 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/index.js && esbuild src/commands/connect/webide-message-worker.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/webide-message-worker.js && tsc --noEmit -p tsconfig.json",
18
- "test:plan-cursor": "esbuild scripts/test-plan-cursor.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/test-plan-cursor.mjs && node dist/test-plan-cursor.mjs",
19
18
  "prepublishOnly": "npm run build"
20
19
  },
21
20
  "devDependencies": {