release v1.0.54

This commit is contained in:
musistudio
2025-10-02 22:22:19 +08:00
parent 07e92468f2
commit ba1a9fff25
3 changed files with 17 additions and 3 deletions

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
pnpm-lock.yaml generated
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

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
@@ -56,9 +58,17 @@ export async function executeCodeCommand(args: string[] = []) {
const stdioConfig: StdioOptions = config.NON_INTERACTIVE_MODE
? ["pipe", "inherit", "inherit"] // Pipe stdin for non-interactive
: "inherit"; // Default inherited behavior
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,