Solution:Remove conflicting configurations or use the right priority level:
# To force project-level, unset environment variableunset ANTHROPIC_API_KEY# To force environment variable, set itexport ANTHROPIC_API_KEY="sk-mega-your-key"
CLI is stuck during execution.Solutions:1. Cancel and retry:
# Press Ctrl+C to cancel# Then run againnpx megallm@latest
2. Check for prompts:
The CLI may be waiting for input. Look for questions like:
“Enter your API key:”
“Continue? (y/n)”
3. Run with debug mode:
DEBUG=* npx megallm@latest# Shows detailed logs of what's happening
4. Check for background processes:
# Check if another instance is runningps aux | grep megallm
Tool not detected
CLI says a tool isn’t installed but it is.Diagnosis:
# Check if tool is globally installednpm list -g --depth=0 | grep claudenpm list -g --depth=0 | grep codexnpm list -g --depth=0 | grep opencode# Check if command is availablewhich claude-codewhich codexwhich windsurfwhich opencode
# Run CLI again to reconfigurenpx megallm@latest# Or update manuallyjq '.env.ANTHROPIC_API_KEY = "new-key"' ~/.claude/settings.json > tmp.json && mv tmp.json ~/.claude/settings.json
3. Clear and reset:
# Remove old configrm ~/.claude/settings.json ~/.claude.jsonrm ~/.codex/config.tomlrm ~/.config/opencode/opencode.json# Run CLI freshnpx megallm@latest
Rate limit exceeded
Too many API requests in a short time.Solution:1. Wait and retry:
Rate limits reset after a period (usually 1 minute).2. Check your usage:
3. Upgrade plan:
If you consistently hit rate limits, consider upgrading your plan.4. Implement retry logic:
# In your application codeimport timeimport openaifor i in range(3): try: response = client.chat.completions.create(...) break except openai.RateLimitError: if i < 2: time.sleep(2 ** i) # Exponential backoff else: raise
PATH isn’t updated for npm global packages.Solution:
# Add npm global bin to PATHecho 'export PATH="$PATH:$(npm config get prefix)/bin"' >> ~/.zshrcsource ~/.zshrc# Or for bashecho 'export PATH="$PATH:$(npm config get prefix)/bin"' >> ~/.bashrcsource ~/.bashrc
Windows: PowerShell execution policy
Scripts are blocked by PowerShell execution policy.Solution:
# Run PowerShell as AdministratorSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser# Then run CLInpx megallm@latest
Linux: /usr/local/lib permission issues
Can’t install global packages due to permissions.Solution:
# Option 1: Use nvm (recommended)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bashnvm install 18nvm use 18# Option 2: Change npm prefixmkdir ~/.npm-globalnpm config set prefix '~/.npm-global'echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrcsource ~/.bashrc