Created
February 6, 2026 07:27
-
-
Save elfgzp/2da858991fa0db6f68641fe0dbcf99b5 to your computer and use it in GitHub Desktop.
CCS Installer v2 - Install to /usr/local/bin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # CC-Switch (ccs) Installer v2 | |
| # Install to /usr/local/bin (requires sudo) | |
| # One-liner: curl -fsSL https://gist.githubusercontent.com/elfgzp/GIST_ID/raw/install_ccs.sh | sudo bash | |
| set -e | |
| INSTALL_DIR="/usr/local/bin" | |
| REPO="saladday/cc-switch-cli" | |
| echo "Installing cc-switch-cli 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 | |
| # Download latest release | |
| echo "Fetching latest release..." | |
| LATEST_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep "browser_download_url.*linux-x64" | head -1 | cut -d '"' -f 4) | |
| if [ -z "$LATEST_URL" ]; then | |
| echo "Error: Could not find latest release" | |
| exit 1 | |
| fi | |
| echo "Downloading from: $LATEST_URL" | |
| curl -fsSL "$LATEST_URL" -o /tmp/cc-switch.tar.gz | |
| tar -xzf /tmp/cc-switch.tar.gz -C "$INSTALL_DIR" | |
| chmod +x "$INSTALL_DIR/cc-switch" | |
| echo "✓ cc-switch installed" | |
| # Download ccs wrapper | |
| echo "Installing ccs wrapper..." | |
| curl -fsSL "https://gist.githubusercontent.com/elfgzp/GIST_ID/raw/ccs" -o "$INSTALL_DIR/ccs" | |
| chmod +x "$INSTALL_DIR/ccs" | |
| echo "✓ ccs installed" | |
| # 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" | |
| echo "" | |
| echo "Note: First time setup requires adding providers:" | |
| echo " ~/bin/cc-switch provider add" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment