@jcanizalez7/clauxy 0.2.3 → 0.2.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/README.md +0 -1
- package/dist/cli.js +11 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,6 @@ That's it! Clauxy starts the proxy and launches Claude Code automatically with t
|
|
|
65
65
|
```bash
|
|
66
66
|
# Default: Start proxy + launch Claude Code
|
|
67
67
|
clauxy # Just works!
|
|
68
|
-
clauxy "fix the bug" # Pass arguments to Claude
|
|
69
68
|
clauxy -p copilot # Use specific provider
|
|
70
69
|
clauxy -c # Re-authenticate before starting
|
|
71
70
|
clauxy --port 3000 # Use specific port (reuses existing proxy if running)
|
package/dist/cli.js
CHANGED
|
@@ -2516,6 +2516,9 @@ var c2 = {
|
|
|
2516
2516
|
bold: (s) => `\x1B[1m${s}\x1B[0m`,
|
|
2517
2517
|
red: (s) => `\x1B[31m${s}\x1B[0m`
|
|
2518
2518
|
};
|
|
2519
|
+
function setTerminalTitle(title) {
|
|
2520
|
+
process.stdout.write(`\x1B]0;${title}\x07`);
|
|
2521
|
+
}
|
|
2519
2522
|
async function findClaudeCli() {
|
|
2520
2523
|
try {
|
|
2521
2524
|
const proc = Bun.spawn(["which", "claude"], {
|
|
@@ -2569,7 +2572,7 @@ async function isClauxyRunning(port) {
|
|
|
2569
2572
|
}
|
|
2570
2573
|
}
|
|
2571
2574
|
async function wrapperCommand(options) {
|
|
2572
|
-
const { logLevel = "warn", connect = false, provider, port: requestedPort
|
|
2575
|
+
const { logLevel = "warn", connect = false, provider, port: requestedPort } = options;
|
|
2573
2576
|
const claudePath = await findClaudeCli();
|
|
2574
2577
|
if (!claudePath) {
|
|
2575
2578
|
console.error(c2.red("Error: Claude CLI not found."));
|
|
@@ -2604,6 +2607,8 @@ Install it with: ${c2.cyan("npm i -g @anthropic-ai/claude-code")}`);
|
|
|
2604
2607
|
}
|
|
2605
2608
|
}
|
|
2606
2609
|
await Config.setActiveProvider(activeProvider);
|
|
2610
|
+
const providerInfo = await getProvider(activeProvider);
|
|
2611
|
+
setTerminalTitle(`${providerInfo.info.name} - Clauxy`);
|
|
2607
2612
|
let proxyPort;
|
|
2608
2613
|
let proxyServer = null;
|
|
2609
2614
|
if (requestedPort && await isClauxyRunning(requestedPort)) {
|
|
@@ -2619,10 +2624,9 @@ Install it with: ${c2.cyan("npm i -g @anthropic-ai/claude-code")}`);
|
|
|
2619
2624
|
});
|
|
2620
2625
|
proxyServer = server;
|
|
2621
2626
|
proxyPort = server.port;
|
|
2622
|
-
const providerInfo = await getProvider(activeProvider);
|
|
2623
2627
|
console.log(`${c2.green(">")} ${c2.bold("Clauxy")} proxy on ${c2.cyan(`localhost:${proxyPort}`)} ${c2.dim(`(${providerInfo.info.name})`)}`);
|
|
2624
2628
|
}
|
|
2625
|
-
const claude = Bun.spawn(["claude"
|
|
2629
|
+
const claude = Bun.spawn(["claude"], {
|
|
2626
2630
|
env: {
|
|
2627
2631
|
...process.env,
|
|
2628
2632
|
ANTHROPIC_BASE_URL: `http://localhost:${proxyPort}`,
|
|
@@ -2796,7 +2800,7 @@ Models configured:`);
|
|
|
2796
2800
|
// package.json
|
|
2797
2801
|
var package_default = {
|
|
2798
2802
|
name: "@jcanizalez7/clauxy",
|
|
2799
|
-
version: "0.2.
|
|
2803
|
+
version: "0.2.5",
|
|
2800
2804
|
description: "Multi-provider AI proxy for Claude Code (GitHub Copilot, ChatGPT Plus, Google Gemini)",
|
|
2801
2805
|
type: "module",
|
|
2802
2806
|
bin: {
|
|
@@ -2949,7 +2953,7 @@ var main = defineCommand({
|
|
|
2949
2953
|
model,
|
|
2950
2954
|
models: model
|
|
2951
2955
|
},
|
|
2952
|
-
async run({ args
|
|
2956
|
+
async run({ args }) {
|
|
2953
2957
|
const port = args.port ? parseInt(args.port, 10) : undefined;
|
|
2954
2958
|
if (args.port && isNaN(port)) {
|
|
2955
2959
|
console.error(`Invalid port number: "${args.port}". Use --port <number> (e.g., --port 3000).`);
|
|
@@ -2959,50 +2963,12 @@ var main = defineCommand({
|
|
|
2959
2963
|
logLevel: args["log-level"],
|
|
2960
2964
|
connect: args.connect,
|
|
2961
2965
|
provider: args.provider,
|
|
2962
|
-
port
|
|
2963
|
-
claudeArgs: rawArgs
|
|
2966
|
+
port
|
|
2964
2967
|
});
|
|
2965
2968
|
}
|
|
2966
2969
|
});
|
|
2967
|
-
var SUBCOMMANDS = ["run", "auth", "model", "models", "--help", "-h", "--version", "-v"];
|
|
2968
2970
|
function cli() {
|
|
2969
|
-
|
|
2970
|
-
const firstArg = args.find((arg) => !arg.startsWith("-"));
|
|
2971
|
-
if (firstArg && !SUBCOMMANDS.includes(firstArg)) {
|
|
2972
|
-
let logLevel = "warn";
|
|
2973
|
-
let connect = false;
|
|
2974
|
-
let provider;
|
|
2975
|
-
let port;
|
|
2976
|
-
const claudeArgs = [];
|
|
2977
|
-
for (let i = 0;i < args.length; i++) {
|
|
2978
|
-
const arg = args[i];
|
|
2979
|
-
if (arg === "-l" || arg === "--log-level") {
|
|
2980
|
-
logLevel = args[++i] || "warn";
|
|
2981
|
-
} else if (arg === "-c" || arg === "--connect") {
|
|
2982
|
-
connect = true;
|
|
2983
|
-
} else if (arg === "-p" || arg === "--provider") {
|
|
2984
|
-
provider = args[++i];
|
|
2985
|
-
} else if (arg === "--port") {
|
|
2986
|
-
const portStr = args[++i];
|
|
2987
|
-
port = portStr ? parseInt(portStr, 10) : undefined;
|
|
2988
|
-
} else if (arg.startsWith("--log-level=")) {
|
|
2989
|
-
logLevel = arg.split("=")[1];
|
|
2990
|
-
} else if (arg.startsWith("--provider=")) {
|
|
2991
|
-
provider = arg.split("=")[1];
|
|
2992
|
-
} else if (arg.startsWith("--port=")) {
|
|
2993
|
-
port = parseInt(arg.split("=")[1], 10);
|
|
2994
|
-
} else if (arg.startsWith("-p=")) {
|
|
2995
|
-
provider = arg.split("=")[1];
|
|
2996
|
-
} else if (arg.startsWith("-l=")) {
|
|
2997
|
-
logLevel = arg.split("=")[1];
|
|
2998
|
-
} else {
|
|
2999
|
-
claudeArgs.push(arg);
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
wrapperCommand({ logLevel, connect, provider, port, claudeArgs });
|
|
3003
|
-
} else {
|
|
3004
|
-
runMain(main);
|
|
3005
|
-
}
|
|
2971
|
+
runMain(main);
|
|
3006
2972
|
}
|
|
3007
2973
|
|
|
3008
2974
|
// cli.ts
|