Enhance install-claude-code.sh with provider switching and coding-helper

Major Features Added:
- Provider Switching: Detect current API provider (Anthropic/Z.AI) and offer switching
- API Key Update: Easy update of existing API keys without reinstalling
- Z.AI Coding-Helper Integration: Optional installation of @z_ai/coding-helper

Provider Detection:
- Detects Z.AI by checking for dashscope-intl.aliyuncs.com URL
- Detects Anthropic by checking for anthropic.com or ANTHROPIC_API_KEY
- Shows current provider and API key (masked) when script runs

Provider Switching Options:
1. Switch to Z.AI (GLM models: glm-4.5-air, glm-4.7)
2. Switch to Anthropic (Official Claude models)
3. Update API key only (keep current provider)
4. Skip configuration

Z.AI Coding-Helper Addons:
- Interactive wizard for easy setup
- Multi-tool management (Claude Code, OpenCode, Crush, Factory Droid)
- MCP service configuration
- API key management for Global and China plans
- Bilingual interface (English/Chinese)
- Automatic tool detection and installation
- Configuration backup and sync

Configuration Management:
- Automatic backup of settings.json before changes
- Smart merging of existing configurations
- Proper model switching (GLM ↔ Claude models)
- Base URL configuration for Z.AI

Enhanced Banner:
- Shows all three main features (Z.AI, Provider Switching, Coding-Helper)

README Updates:
- Documented new features in install-claude-code.sh section
- Added provider switching workflow explanation
- Listed coding-helper addon features
This commit is contained in:
uroma
2026-01-22 16:09:22 +00:00
Unverified
parent ddd42d0063
commit 2ad21eb5d1
2 changed files with 474 additions and 59 deletions

View File

@@ -180,26 +180,45 @@ curl -fsSL https://github.rommark.dev/admin/SuperCharged-Claude-Code-Upgrade/raw
```
### install-claude-code.sh - Claude Code + Z.AI Installer
Installs Claude Code and configures Z.AI GLM models.
Installs Claude Code and configures Z.AI GLM models or Anthropic API.
**New Features:**
- 🔀 **Provider Switching** - Switch between Anthropic and Z.AI APIs
- 🔑 **API Key Update** - Update existing API keys easily
- 🧩 **Coding-Helper Addons** - Optional Z.AI coding-helper installation
| Option | Description |
|--------|-------------|
| `--auto` (default) | Automated installation with API key prompt |
| `--auto` (default) | Automated installation with provider selection |
| `--manual` | Show manual installation steps only |
| `--skip-install` | Skip Claude Code install, configure API only |
**One-liners:**
```bash
# Auto install with API prompt
# Auto install with provider selection
curl -fsSL https://github.rommark.dev/admin/SuperCharged-Claude-Code-Upgrade/raw/main/install-claude-code.sh | bash
# Show manual instructions
curl -fsSL https://github.rommark.dev/admin/SuperCharged-Claude-Code-Upgrade/raw/main/install-claude-code.sh | bash -s -- --manual
# Configure API only
# Configure API only (skip Claude Code install)
curl -fsSL https://github.rommark.dev/admin/SuperCharged-Claude-Code-Upgrade/raw/main/install-claude-code.sh | bash -s -- --skip-install
```
**Provider Switching:**
If Claude Code is already installed, the script will:
1. Detect your current API provider (Anthropic or Z.AI)
2. Offer to switch between providers
3. Allow you to update your API key
4. Optionally install Z.AI coding-helper addons
**Z.AI Coding-Helper Features:**
- Interactive wizard for easy setup
- Multi-tool management (Claude Code, OpenCode, etc.)
- MCP service configuration
- API key management for Global and China plans
- Bilingual interface (English/Chinese)
---
## 🔧 Claude Code Installation Details