Commit Graph

13 Commits

  • Fix: Handle npm EACCES permission errors gracefully
    Root Cause: npm install -g @z_ai/coding-helper was failing with EACCES
    (permission denied) when trying to create /usr/local/lib/node_modules/@z_ai,
    but the error was being suppressed by 2>/dev/null in the original version.
    
    The script would report "Installation completed" even though it failed.
    
    Solution: Enhanced error handling with three paths:
    
    1. Success Path (exit code = 0):
       - Verify installation with 'npm list -g'
       - Show "installed and verified!" message
       - Offer to launch wizard
    
    2. Permission Error Path (EACCES detected):
       - Clear error message explaining the permission issue
       - Show 3 options:
         a) Use sudo (with interactive retry)
         b) Fix npm permissions permanently (chown command)
         c) Run without installation using npx
       - Interactive prompt to try sudo immediately
    
    3. Other Error Path:
       - Show full error output
       - Suggest manual installation with sudo
       - Remind that npx works without installation
    
    Changes:
    - install_coding_helper(): Added EACCES detection, sudo retry option,
      and clear error messages for all failure scenarios
    - Error output is now captured and displayed for debugging
    - Added verification step after sudo installation
    
    The script now properly handles the common case where users don't have
    write permissions to /usr/local/lib/node_modules and offers multiple
    solutions including an interactive sudo retry.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
  • Fix: coding-helper detection and installation feedback
    Fixed 3 bugs related to coding-helper detection and installation:
    
    1. Detection Bug: Wizard and bilingual checks only looked for 'chelper'
       command, but the npm package @z_ai/coding-helper doesn't create this
       command - it's run via 'npx @z_ai/coding-helper'.
    
       Fixed by adding 'npm list -g @z_ai/coding-helper' check to both:
       - wizard detection (line 505)
       - bilingual detection (line 542)
    
    2. Misleading Success Message: When npm install failed, the script said
       "Installation completed. You can run manually with:" which sounded
       like it succeeded.
    
       Fixed by:
       - Capturing both stdout and stderr
       - Checking actual exit code
       - Showing "Installation failed!" with error output
       - Providing clearer manual installation instructions
    
    3. No Installation Verification: After npm install appeared to succeed,
       there was no verification that the package was actually installed.
    
       Fixed by:
       - Adding npm list -g verification after install
       - Showing "installed and verified!" on success
       - Warning if installation appeared to succeed but verification failed
    
    Changes:
    - detect_coding_helper_components(): Added npm list check to wizard
      and bilingual detection
    - install_coding_helper(): Added error capture, exit code checking,
      verification step, and proper error messages
    - Removed misleading "chelper" command from success message (it's
      npx @z_ai/coding-helper, not chelper)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
  • Add: Installation status detection for coding-helper components
    Added comprehensive component detection that shows which features are
    already installed and which are missing.
    
    New functions:
    - detect_coding_helper_components(): Returns JSON with status of all
      10 components (core, wizard, multi_tool, mcp_config, api_management,
      bilingual, mcp_servers, marketplace, tool_detection, backup_sync)
    - display_component_status(): Shows colored ✓ or ✗ with [Installed]
      or [Not installed] status
    
    Enhanced offer_coding_helper_addons():
    - Detects and displays status for each component individually
    - Shows summary: "X/10 components installed"
    - Smart handling based on installation state:
      * All installed: Offer to launch wizard
      * Core installed, missing components: Offer to configure
      * Not installed: Offer to install
    
    Detection checks:
    - Core: chelper command or npm package
    - Wizard: chelper availability
    - Multi-tool: ~/.chelper config directory
    - MCP config: mcpServers in settings.json
    - API management: Z.AI base URL in settings
    - Bilingual: inherent to chelper
    - MCP servers: plugins/*mcp* or *zai* count
    - Marketplace: marketplace in config.json
    - Tool detection: tool-discovery-agent skill
    - Backup sync: sync-agents.sh script
    
    Co-Authored-By: Claude <noreply@anthropic.com>
  • Fix: Raw ANSI escape codes displaying instead of colors
    Fixed 8 echo commands missing -e flag that were displaying raw
    escape sequences like \033[0;32m instead of colored output.
    
    - Z.AI coding-helper feature list (5 lines)
    - Manual command hint
    - Discount link display (2 lines)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
  • Fix: Interactive input not working with curl | bash
    All `read -p` commands now redirect stdin from /dev/tty instead of
    piped stdin. This fixes the bug where menu prompts immediately failed
    with "Invalid choice" when script was executed via curl | bash.
    
    Fixed 10 read commands throughout the script:
    - Provider selection menu
    - API key input prompts
    - Installation confirmation prompts
    - Coding-helper installation prompts
    
    Co-Authored-By: Claude <noreply@anthropic.com>
  • 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
  • Add one-line command options for all scripts
    Added comprehensive one-line installation options for all scripts:
    
    Quick One-Liners Section (top of README):
    - SuperCharge installer one-liner
    - Claude Code + Z.AI installer one-liner
    - Manual instructions one-liner
    
    Detailed Installation Guide:
    - SuperCharge Installer with all options
    - Claude Code + Z.AI Installer with all options
    - All scripts support argument passing via bash -s --
    
    Available Scripts Reference:
    - supercharge.sh: Main installer with --skip-deps, --dev-mode
    - install-claude-code.sh: Claude Code + Z.AI with --auto, --manual, --skip-install
    
    Total: 16 one-liner command examples
    
    Features:
    - curl | bash for direct execution
    - bash -s -- for argument passing
    - All script options documented
    - Clear tables showing options and descriptions
  • SEO-optimized README rewrite
    Multi-AI collaboration (Content + SEO + Web + PM agents) complete rewrite with:
    
    SEO Enhancements:
    - Keyword-optimized H1 title and description
    - Strategic heading structure (H1, H2, H3)
    - Primary keywords: Claude Code customization, skills, agents, Z.AI API
    - Long-tail keywords in natural context
    - Internal links to INVENTORY.md
    - External links to official docs
    - Social proof badges (skills count, agents, license)
    - Keywords section at bottom for discoverability
    
    Content Improvements:
    - Compelling above-the-fold value proposition
    - Feature highlights with emojis for scannability
    - Clear installation instructions (one-line + manual)
    - Comprehensive usage examples
    - Troubleshooting section
    - Structured with tables and code blocks
    - Contributing guidelines
    - Star History badge
    - Support links
    
    Target Keywords:
    - Claude Code customization
    - Claude Code skills
    - Claude Code agents
    - Z.AI API integration
    - GLM models
    - RalphLoop autonomous agent
    - MCP servers
    - AI workflow automation
  • Add 10% OFF discount link for z.ai coding plan
    Added discount offer link in multiple locations:
    - README.md: In "What is Z.AI API?" section
    - install-claude-code.sh: In hero banner, API key prompt, and manual instructions
    
    Discount link: https://z.ai/subscribe?ic=R0K78RJKNW
  • 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
  • Fix: Convert all shell scripts from CRLF to LF
    Fixed Windows line endings (CRLF) in all shell scripts to Unix format (LF):
    - supercharge.sh (main installation script)
    - agents/*.sh (all agent management scripts)
    - hooks/*.sh (all hook scripts)
    - skills/ui-ux-pro-max/scripts/wordpress_safe_update.sh
    
    All scripts now pass bash syntax validation.
  • SuperCharge Claude Code v1.0.0 - Complete Customization Package
    Features:
    - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents)
    - RalphLoop autonomous agent integration
    - Multi-AI consultation (Qwen)
    - Agent management system with sync capabilities
    - Custom hooks for session management
    - MCP servers integration
    - Plugin marketplace setup
    - Comprehensive installation script
    
    Components:
    - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc.
    - Agents: 100+ agents across engineering, marketing, product, etc.
    - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger
    - Commands: /brainstorm, /write-plan, /execute-plan
    - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread
    - Binaries: ralphloop wrapper
    
    Installation: ./supercharge.sh