api-switch-cc 0.2.3 → 0.2.4
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/install.js +15 -7
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -69,8 +69,11 @@ function install() {
|
|
|
69
69
|
console.log(`Downloading ${DOWNLOAD_VERSION} for ${plat} ...`);
|
|
70
70
|
|
|
71
71
|
try {
|
|
72
|
-
// Download
|
|
73
|
-
execSync(
|
|
72
|
+
// Download with retry and longer timeout
|
|
73
|
+
execSync(
|
|
74
|
+
`curl -sSL --connect-timeout 10 --max-time 120 --retry 3 "${url}" -o "${tmp}"`,
|
|
75
|
+
{ stdio: "pipe", timeout: 180000 }
|
|
76
|
+
);
|
|
74
77
|
|
|
75
78
|
// Extract (archive contains binary named api-switch-<plat>)
|
|
76
79
|
const archiveBin = archivedBinaryName();
|
|
@@ -92,11 +95,16 @@ function install() {
|
|
|
92
95
|
console.log(`Installed to ${binPath}`);
|
|
93
96
|
} catch (err) {
|
|
94
97
|
console.error(`Download failed: ${err.message}`);
|
|
95
|
-
console.log(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
);
|
|
98
|
+
console.log();
|
|
99
|
+
console.log("Manual installation:");
|
|
100
|
+
console.log(` curl -sSL "${url}" | tar xz`);
|
|
101
|
+
console.log(` sudo cp ${join(".", archiveBin)} /usr/local/bin/api-switch`);
|
|
102
|
+
console.log();
|
|
103
|
+
console.log("Or install from source (requires Go):");
|
|
104
|
+
console.log(" git clone https://github.com/hxz0727/API-Switch.git");
|
|
105
|
+
console.log(" cd API-Switch && make build");
|
|
106
|
+
console.log(" make install");
|
|
107
|
+
process.exit(1);
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "api-switch-cc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Claude Code 多模型代理 — 一键切换 DeepSeek、Qwen、GLM、Moonshot 等国产大模型,协议自动转换,零配置即用。LLM API proxy for Claude Code with DeepSeek, Qwen, Anthropic, OpenAI support.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"api-switch": "bin/api-switch"
|