Skip to content

Instantly share code, notes, and snippets.

@elfgzp
Created February 6, 2026 07:30
Show Gist options
  • Select an option

  • Save elfgzp/f0b08ee92d64f0bd92d7e36189e3e6f8 to your computer and use it in GitHub Desktop.

Select an option

Save elfgzp/f0b08ee92d64f0bd92d7e36189e3e6f8 to your computer and use it in GitHub Desktop.
CCS Installer v4 - Fixed URLs, no API calls
#!/bin/bash
# CC-Switch (ccs) Installer v4
# Install to /usr/local/bin (requires sudo)
# One-liner: curl -fsSL https://gist.githubusercontent.com/elfgzp/GIST_ID/raw | sudo bash
set -e
INSTALL_DIR="/usr/local/bin"
VERSION="v4.6.2"
echo "Installing cc-switch-cli $VERSION to $INSTALL_DIR..."
# Check if running with sudo
if [ "$EUID" -ne 0 ]; then
echo "Please run with sudo: curl -fsSL ... | sudo bash"
exit 1
fi
# Detect architecture
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH_SUFFIX="linux-x64-musl"
;;
aarch64|arm64)
ARCH_SUFFIX="linux-arm64-musl"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
# Construct download URL
DOWNLOAD_URL="https://github.com/SaladDay/cc-switch-cli/releases/download/$VERSION/cc-switch-cli-$ARCH_SUFFIX.tar.gz"
echo "Downloading from: $DOWNLOAD_URL"
if ! curl -fsSL "$DOWNLOAD_URL" -o /tmp/cc-switch.tar.gz; then
echo "Error: Failed to download"
echo "Trying alternative URL..."
# Try without -musl suffix
ARCH_SUFFIX_ALT=$(echo "$ARCH_SUFFIX" | sed 's/-musl//')
DOWNLOAD_URL_ALT="https://github.com/SaladDay/cc-switch-cli/releases/download/$VERSION/cc-switch-cli-$ARCH_SUFFIX_ALT.tar.gz"
echo "Trying: $DOWNLOAD_URL_ALT"
curl -fsSL "$DOWNLOAD_URL_ALT" -o /tmp/cc-switch.tar.gz
fi
tar -xzf /tmp/cc-switch.tar.gz -C "$INSTALL_DIR"
chmod +x "$INSTALL_DIR/cc-switch"
echo "✓ cc-switch installed to $INSTALL_DIR"
# Download ccs wrapper
echo "Installing ccs wrapper..."
CCS_URL="https://gist.githubusercontent.com/elfgzp/b81e8e4a063b65bae47134075acaf923/raw/ccs"
if ! curl -fsSL "$CCS_URL" -o "$INSTALL_DIR/ccs"; then
echo "Error: Failed to download ccs wrapper"
exit 1
fi
chmod +x "$INSTALL_DIR/ccs"
echo "✓ ccs installed to $INSTALL_DIR"
# Clean up
rm -f /tmp/cc-switch.tar.gz
echo ""
echo "✓ Installation complete!"
echo ""
echo "Usage:"
echo " ccs glm # Switch to Z.ai GLM-4.7"
echo " ccs kimi # Switch to Kimi Coding"
echo " ccs minimax # Switch to MiniMax M2.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment