Merge branch 'main' into dev/lib

# Conflicts:
#	src/utils/codeCommand.ts
This commit is contained in:
musistudio
2025-10-03 09:10:04 +08:00
3 changed files with 16 additions and 4 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@musistudio/claude-code-router",
"version": "1.0.53",
"version": "1.0.54",
"description": "Use Claude Code without an Anthropics account and route it to another LLM provider",
"bin": {
"ccr": "dist/cli.js"
@@ -24,6 +24,7 @@
"dotenv": "^16.4.7",
"find-process": "^2.0.0",
"json5": "^2.2.3",
"minimist": "^1.2.8",
"openurl": "^1.1.1",
"rotating-file-stream": "^3.2.7",
"shell-quote": "^1.8.3",
+3
View File
@@ -23,6 +23,9 @@ importers:
json5:
specifier: ^2.2.3
version: 2.2.3
minimist:
specifier: ^1.2.8
version: 1.2.8
openurl:
specifier: ^1.1.1
version: 1.1.1
+11 -3
View File
@@ -6,6 +6,8 @@ import {
incrementReferenceCount,
} from "./processCheck";
import { quote } from 'shell-quote';
import minimist from "minimist";
export async function executeCodeCommand(args: string[] = []) {
// Set environment variables
@@ -57,10 +59,16 @@ export async function executeCodeCommand(args: string[] = []) {
? ["pipe", "inherit", "inherit"] // Pipe stdin for non-interactive
: "inherit"; // Default inherited behavior
console.log(claudePath + (joinedArgs ? ` ${joinedArgs}` : ""))
const argsObj = minimist(args)
const argsArr = []
for (const [argsObjKey, argsObjValue] of Object.entries(argsObj)) {
if (argsObjKey !== '_' && argsObj[argsObjKey]) {
argsArr.push(`${argsObjKey.length === 1 ? '-' : '--'}${argsObjKey} ${JSON.stringify(argsObjValue)}`);
}
}
const claudeProcess = spawn(
claudePath + (joinedArgs ? ` ${joinedArgs}` : ""),
[],
claudePath,
argsArr,
{
env: process.env,
stdio: stdioConfig,