### Install Dependencies and Start Development Server Source: https://github.com/farion1231/cc-switch/blob/main/CONTRIBUTING.md Use these commands to set up the development environment and start the hot-reloading server. ```bash pnpm install pnpm dev ``` -------------------------------- ### Install and Run Flatpak Source: https://github.com/farion1231/cc-switch/blob/main/flatpak/README.md Install the generated bundle and launch the application. ```bash flatpak install --user ./CC-Switch-Linux.flatpak flatpak run com.ccswitch.desktop ``` -------------------------------- ### Custom Repository Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/3-extensions/3.3-skills.md Example of the information required to add a custom repository. ```text Owner: anthropics Name: claude-skills Branch: main Subdirectory: skills ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/farion1231/cc-switch/blob/main/README.md Installs all necessary project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Install CC Switch on Debian/Ubuntu Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install CC Switch on Debian or Ubuntu systems by downloading the appropriate .deb package and installing it using dpkg. ```bash sudo dpkg -i CC-Switch-v{version}-Linux-*.deb # If there are dependency issues sudo apt-get install -f ``` -------------------------------- ### Skill Installation Directory Structure Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/3-extensions/3.3-skills.md Illustrates the typical file structure of a skill when installed locally. This structure is common across supported applications. ```text ~/.claude/skills/ └── skill-name/ ├── README.md ├── prompt.md └── tools/ └── ... ``` -------------------------------- ### Install Flatpak Dependencies Source: https://github.com/farion1231/cc-switch/blob/main/flatpak/README.md Install the necessary Flatpak tools and runtimes on Ubuntu or Debian systems. ```bash sudo apt install flatpak flatpak-builder flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install -y --user flathub org.gnome.Platform//46 org.gnome.Sdk//46 ``` -------------------------------- ### Prompt Preset Import Deep Link Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.3-deeplink.md Example of a deep link for importing a prompt preset. The 'content' and 'name' parameters are URL-encoded. ```text ccswitch://v1/import?resource=prompt&app=claude&name=%E4%BB%A3%E7%A0%81%E5%AE%A1%E6%9F%A5&content=%23%20%E8%A7%92%E8%89%B2%0A%E4%BD%A0%E6%98%AF%E4%B8%80%E4%B8%AA%E4%B8%93%E4%B8%9A%E7%9A%84%E4%BB%A3%E7%A0%81%E5%AE%A1%E6%9F%A5%E4%B8%93%E5%AE%B6 ``` -------------------------------- ### Install CC Switch .rpm package on openSUSE Source: https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v3.16.4-en.md Install the CC Switch .rpm package on openSUSE using zypper. This command is specific to the openSUSE distribution. ```bash sudo zypper install ./CC-Switch-*.rpm ``` -------------------------------- ### Start Development Server with Hot Reload Source: https://github.com/farion1231/cc-switch/blob/main/README.md Launches the development server with hot reloading enabled for rapid development. ```bash pnpm dev ``` -------------------------------- ### Verify Node.js Installation Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Check if Node.js and npm are installed correctly by running these commands in your terminal. ```bash node --version npm --version ``` -------------------------------- ### Install Gemini CLI Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install the Gemini CLI tool using Homebrew on macOS or npm globally. ```bash # Option 1: Homebrew (recommended for macOS) brew install gemini-cli # Option 2: npm npm install -g @google/gemini-cli ``` -------------------------------- ### Install CC Switch on macOS using Homebrew Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install CC Switch on macOS using Homebrew. This is the recommended installation method for macOS users. ```bash # Install brew install --cask cc-switch # Update to the latest version: brew upgrade --cask cc-switch ``` -------------------------------- ### OpenClaw JSON5 Configuration Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.1-config-files.md An example of the JSON5 configuration structure for OpenClaw, including model providers, environment variables, and agent defaults. ```json5 { // Model provider configuration models: { mode: "merge", providers: { "custom-provider": { baseUrl: "https://api.example.com/v1", apiKey: "your-api-key", api: "openai-completions", models: [{ id: "model-id", name: "Model Name" }] } } }, // Environment variables env: { ANTHROPIC_API_KEY: "sk-..." }, // Agent default configuration agents: { defaults: { model: { primary: "provider/model" }, workspace: "~/.openclaw/workspace" } }, // Tool configuration tools: {} } ``` -------------------------------- ### Install CC Switch via paru on Arch Linux Source: https://github.com/farion1231/cc-switch/blob/main/README.md Install CC Switch on Arch Linux using the paru AUR helper. This is the recommended installation method for Arch users. ```bash paru -S cc-switch-bin ``` -------------------------------- ### Provider Import Deep Link Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.3-deeplink.md Example of a deep link for importing a provider configuration. Ensure to URL-encode parameters if generating manually. ```text ccswitch://v1/import?resource=provider&app=claude&name=My%20Provider&endpoint=https%3A%2F%2Fapi.example.com&apiKey=sk-xxx ``` -------------------------------- ### CC Switch Device Settings JSON Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.1-config-files.md Example of the settings.json file, which stores device-level configurations. ```json { "language": "zh", "theme": "system", "windowBehavior": "minimize", "autoStart": false, "claudeConfigDir": null, "codexConfigDir": null, "geminiConfigDir": null, "opencodeConfigDir": null, "openclawConfigDir": null, "hermesConfigDir": null } ``` -------------------------------- ### Install CC Switch on ArchLinux Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install CC Switch on ArchLinux using an AUR helper like paru or yay. ```bash # Using paru paru -S cc-switch-bin # Or using yay yay -S cc-switch-bin ``` -------------------------------- ### Install Node.js on Linux (Debian/Ubuntu) Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install the LTS version of Node.js on Debian or Ubuntu systems using the NodeSource repository. ```bash # Ubuntu/Debian curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs # Or use nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash nvm install --lts ``` -------------------------------- ### Skill Import Deep Link Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.3-deeplink.md Example of a deep link for importing a skill from a Git repository. Specify the owner/name of the repository and optionally a directory and branch. ```text ccswitch://v1/import?resource=skill&name=my-skill&repo=owner/repo&directory=skills/my-skill&branch=main ``` -------------------------------- ### Example: Import MCP Server Deep Link Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.3-deeplink.md This is an example of a CC Switch deep link used to import an MCP server configuration. The config parameter is a Base64 encoded JSON string. ```url ccswitch://v1/import?resource=mcp&name=mcp-fetch&apps=claude,codex,gemini&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-fetch%22%5D%7D ``` -------------------------------- ### Failover Queue Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/4-proxy/4.1-service.md Illustrates the failover queue for different application types, showing the priority order of providers and their current health status. ```text Claude ├── 1. PackyCode [Currently Using] ● ├── 2. AIGoCode ● └── 3. Backup Provider ○ Codex ├── 1. AIGoCode [Currently Using] ● └── 2. Backup Provider ● ``` -------------------------------- ### Install Node.js on macOS using Homebrew or nvm Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install Node.js on macOS using either Homebrew or the Node Version Manager (nvm). nvm is recommended for managing multiple Node.js versions. ```bash # Install with Homebrew brew install node # Or use nvm (recommended) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash nvm install --lts ``` -------------------------------- ### Example: Import Claude Provider Deep Link Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.3-deeplink.md This is an example of a CC Switch deep link used to import a provider configuration for the Claude application. Ensure API keys are not shared publicly. ```url ccswitch://v1/import?resource=provider&app=claude&name=Test%20Provider&apiKey=sk-xxx&endpoint=https%3A%2F%2Fapi.example.com ``` -------------------------------- ### MCP Server Import Deep Link Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.3-deeplink.md Example of a deep link for importing an MCP server configuration. The 'config' parameter is a JSON string that needs to be URL-encoded. ```text ccswitch://v1/import?resource=mcp&apps=claude,codex&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-fetch%22%5D%7D&name=mcp-fetch ``` -------------------------------- ### Gemini Configuration for Proxy Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/4-proxy/4.1-service.md Example environment variable setting for Gemini, defining GOOGLE_GEMINI_BASE_URL to direct requests to the local proxy. ```shell GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:15721 ``` -------------------------------- ### OpenCode Configuration Directory and Key Files Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.1-config-files.md Shows the default configuration directory and the structure of key files for OpenCode. ```text ~/.config/opencode/ ├── opencode.json # Main configuration file ├── AGENTS.md # System prompt └── skills/ # Skills directory └── ... ``` -------------------------------- ### Build Production Application Source: https://github.com/farion1231/cc-switch/blob/main/README.md Compiles and builds the application for production deployment. ```bash pnpm build ``` -------------------------------- ### Install CC Switch .rpm package on Fedora-based Linux Source: https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v3.16.4-en.md Install the CC Switch .rpm package on Fedora, RHEL, CentOS, or Rocky Linux. This command handles dependencies if using 'dnf install'. ```bash sudo rpm -i CC-Switch-*.rpm sudo dnf install ./CC-Switch-*.rpm ``` -------------------------------- ### Install CC Switch .deb package on Debian-based Linux Source: https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v3.16.4-en.md Install the CC Switch .deb package on Ubuntu, Debian, Linux Mint, or Pop!_OS. This command handles dependencies if using 'apt install'. ```bash sudo dpkg -i CC-Switch-*.deb sudo apt install ./CC-Switch-*.deb ``` -------------------------------- ### Build and Bundle Flatpak Source: https://github.com/farion1231/cc-switch/blob/main/flatpak/README.md Build the local repository and export the final .flatpak bundle. ```bash flatpak-builder --force-clean --user --disable-cache --repo flatpak-repo flatpak-build flatpak/com.ccswitch.desktop.yml flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo flatpak-repo CC-Switch-Linux.flatpak com.ccswitch.desktop ``` -------------------------------- ### Install Codex CLI Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install the Codex CLI tool using Homebrew on macOS or npm globally. ```bash # Option 1: Homebrew (recommended for macOS) brew install codex # Option 2: npm npm install -g @openai/codex ``` -------------------------------- ### Verify CLI Tool Configuration Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.4-quickstart.md Test the configuration by launching the CLI tool and sending a test prompt. ```bash # Claude Code - enter a test question after launching claude > Hello, please briefly introduce yourself # Codex - enter a test question after launching codex > Hello, please briefly introduce yourself # Gemini - enter a test question after launching gemini > Hello, please briefly introduce yourself # OpenCode - enter a test question after launching opencode > Hello, please briefly introduce yourself # OpenClaw - enter a test question after launching openclaw > Hello, please briefly introduce yourself ``` -------------------------------- ### Install Claude Code CLI Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.2-installation.md Install the Claude Code CLI tool using Homebrew on macOS or npm globally. ```bash # Option 1: Homebrew (recommended for macOS) brew install claude-code # Option 2: npm npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### Claude Configuration Example Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/2-providers/2.2-switch.md This JSON snippet shows the structure for configuring Claude API keys and base URLs within the settings.json file. Ensure these values are updated when switching to a new Claude provider. ```json { "env": { "ANTHROPIC_API_KEY": "new API Key", "ANTHROPIC_BASE_URL": "new endpoint" } } ``` -------------------------------- ### Example Prompt Structure Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/3-extensions/3.2-prompts.md Use a structured format for your prompts to define the AI's role, capabilities, and response style. This helps ensure consistent and effective AI behavior. ```markdown # Role Definition You are a professional code review expert. ## Core Capabilities - Code quality analysis - Performance optimization suggestions - Security vulnerability detection ## Response Style - Clear and concise - Provide specific examples - Give improvement suggestions ## Notes - Do not modify business logic - Maintain consistent code style ``` -------------------------------- ### Install/Update CLI Tools with npm and pip Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/1-getting-started/1.5-settings.md Use these npm and pip commands to install or update various command-line interface tools. Run these commands in your terminal. ```bash npm i -g @anthropic-ai/claude-code@latest npm i -g @openai/codex@latest npm i -g @google/gemini-cli@latest npm i -g opencode-ai@latest npm i -g openclaw@latest python3 -m pip install --upgrade "hermes-agent[web]" ``` -------------------------------- ### OpenClaw Configuration Directory and Key Files Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/5-faq/5.1-config-files.md Lists the default configuration directory and the main configuration file for OpenClaw. ```text ~/.openclaw/ ├── openclaw.json # Main configuration file (JSON5 format) └── skills/ # Skills directory └── ... ``` -------------------------------- ### Prepare Debian Artifact for Flatpak Source: https://github.com/farion1231/cc-switch/blob/main/flatpak/README.md Copy the generated .deb file into the flatpak directory. ```bash cp "$(find src-tauri/target/release/bundle -name '*.deb' | head -n 1)" flatpak/cc-switch.deb ``` -------------------------------- ### Codex MCP Server Configuration Source: https://github.com/farion1231/cc-switch/blob/main/docs/user-manual/en/3-extensions/3.1-mcp.md Example of an MCP server configuration file for Codex, using TOML format. ```toml [mcp_servers.mcp-fetch] command = "uvx" args = ["mcp-server-fetch"] ```