Add optional Claude Code installation with Z.AI API support
Features: - New install-claude-code.sh script for automated Claude Code installation - Z.AI API integration (GLM models: glm-4.5-air, glm-4.7) - Automated and manual installation modes - Supercharge.sh now offers to install Claude Code if not present - Updated README with comprehensive Claude Code installation guide Z.AI Models: - glm-4.5-air: Fast, efficient model (Haiku class) - glm-4.7: Powerful model (Sonnet/Opus class) Documentation: https://docs.z.ai/devpack/tool/claude
This commit is contained in:
@@ -13,10 +13,16 @@
|
||||
# - Custom hooks for session management
|
||||
# - MCP servers integration
|
||||
# - Plugin marketplace setup
|
||||
# - Optional Claude Code installation with Z.AI API support
|
||||
#
|
||||
# Usage: ./supercharge.sh [options]
|
||||
# --skip-deps Skip dependency installation
|
||||
# --dev-mode Development mode (verbose output)
|
||||
#
|
||||
# For Claude Code installation: ./install-claude-code.sh [options]
|
||||
# --auto Automatic installation with API key prompt (default)
|
||||
# --manual Show manual installation steps only
|
||||
# --skip-install Skip Claude Code installation, just configure API
|
||||
################################################################################
|
||||
|
||||
set -e
|
||||
@@ -97,12 +103,48 @@ check_claude_code() {
|
||||
log_step "Checking for Claude Code installation..."
|
||||
|
||||
if ! command -v claude &> /dev/null; then
|
||||
log_error "Claude Code CLI not found!"
|
||||
echo "Please install Claude Code first: https://claude.com/claude-code"
|
||||
exit 1
|
||||
log_warn "Claude Code CLI not found!"
|
||||
echo ""
|
||||
echo -e "${YELLOW}Claude Code is required to use these customizations.${NC}"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " 1. Install Claude Code with Z.AI API support (recommended)"
|
||||
echo " 2. Install manually later"
|
||||
echo " 3. Exit to install first"
|
||||
echo ""
|
||||
read -p "Choose option [1/2/3]: " -n 1 -r choice
|
||||
echo ""
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
log_info "Running Claude Code installer..."
|
||||
bash "$SCRIPT_DIR/install-claude-code.sh" --auto
|
||||
if ! command -v claude &> /dev/null; then
|
||||
log_error "Claude Code installation failed. Please install manually."
|
||||
exit 1
|
||||
fi
|
||||
log_success "Claude Code installed successfully"
|
||||
;;
|
||||
2)
|
||||
log_warn "Skipping Claude Code installation"
|
||||
log_info "You can install it later with: ./install-claude-code.sh"
|
||||
return 1
|
||||
;;
|
||||
3)
|
||||
log_info "Please install Claude Code first:"
|
||||
echo " npm install -g @anthropic-ai/claude-code"
|
||||
echo " Or run: ./install-claude-code.sh"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
log_error "Invalid choice"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
log_success "Claude Code found: $(claude --version 2>/dev/null || echo 'installed')"
|
||||
return 0
|
||||
}
|
||||
|
||||
backup_existing_config() {
|
||||
@@ -420,7 +462,15 @@ main() {
|
||||
done
|
||||
|
||||
# Run installation steps
|
||||
check_claude_code
|
||||
if ! check_claude_code; then
|
||||
log_info "Customizations installed. Install Claude Code to use them."
|
||||
echo ""
|
||||
echo -e "${CYAN}Install Claude Code:${NC}"
|
||||
echo " npm install -g @anthropic-ai/claude-code"
|
||||
echo " Or run: ./install-claude-code.sh"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
backup_existing_config
|
||||
install_dependencies
|
||||
install_skills
|
||||
|
||||
Reference in New Issue
Block a user