api-switch-cc 0.2.5 → 0.2.7

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.
Files changed (2) hide show
  1. package/install.js +4 -4
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -19,7 +19,7 @@ const { join } = require("path");
19
19
  const { execSync } = require("child_process");
20
20
 
21
21
  const PKG = require("./package.json");
22
- const DOWNLOAD_VERSION = "v0.2.0";
22
+ const DOWNLOAD_VERSION = "v0.2.1";
23
23
  const GH_RELEASE = `https://github.com/hxz0727/API-Switch/releases/download/${DOWNLOAD_VERSION}`;
24
24
  const BIN_DIR = join(__dirname, "bin");
25
25
 
@@ -62,7 +62,7 @@ function install() {
62
62
  console.error("Installation failed. Try one of these:");
63
63
  console.error();
64
64
  console.error(" # Option A: Install via Go (quickest)");
65
- console.error(" GOPROXY=https://goproxy.cn,direct go install github.com/hxz0727/API-Switch/cmd/api-switch@v0.2.0");
65
+ console.error(" GOPROXY=https://goproxy.cn,direct go install github.com/hxz0727/API-Switch/cmd/api-switch@v0.2.1");
66
66
  console.error(" sudo cp ~/go/bin/api-switch /usr/local/bin/");
67
67
  console.error();
68
68
  console.error(" # Option B: Download binary directly");
@@ -81,9 +81,9 @@ function install() {
81
81
  function tryGoInstall(binPath, name) {
82
82
  try {
83
83
  console.log("Trying go install (works behind GFW)...");
84
- // Use goproxy.cn for Chinese users, fallback to default for others
84
+ // Use goproxy.cn for Chinese users who can't reach proxy.golang.org
85
85
  execSync(
86
- `go install github.com/hxz0727/API-Switch/cmd/api-switch@${DOWNLOAD_VERSION}`,
86
+ `GOPROXY=https://goproxy.cn,direct GOTOOLCHAIN=local go install github.com/hxz0727/API-Switch/cmd/api-switch@${DOWNLOAD_VERSION}`,
87
87
  { stdio: "pipe", timeout: 120000 }
88
88
  );
89
89
  // go install puts binary in GOPATH/bin or ~/go/bin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-switch-cc",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
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"