Package Exports
- megallm
- megallm/src/cli.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (megallm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MegaLLM Setup Tool
🚀 Configure Claude Code & Codex for MegaLLM with One Command
Quick Start • Features • How It Works • Documentation • Support
🎯 Quick Start
npx megallm@latest
That's it! The interactive CLI will guide you through the entire setup process.
✨ Features
🔍 Smart Detection
|
🔧 Automated Setup
|
🔐 Secure & Safe
|
🌍 Universal Support
|
📊 How It Works
🔄 Setup Process Flow
┌─────────────────┐
│ npx megallm │
└────────┬────────┘
▼
┌─────────────────────────────────────┐
│ 🔍 Environment Detection │
├─────────────────────────────────────┤
│ • Operating System (Mac/Linux/Win) │
│ • Shell Type (bash/zsh/fish/PS) │
│ • Installed Tools (Claude/Codex) │
└────────┬────────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 🔑 API Key Setup │
├─────────────────────────────────────┤
│ Have API Key? │
│ ├─ No → Opens megallm.io │
│ │ Shows instructions │
│ │ Waits for key entry │
│ └─ Yes → Enter API key │
└────────┬────────────────────────────┘
▼
┌─────────────────────────────────────┐
│ ⚙️ Configuration Choice │
├─────────────────────────────────────┤
│ Tool Selection: │
│ • Claude Code only │
│ • Codex/Windsurf only │
│ • Both tools │
│ │
│ Setup Level: │
│ • System (~/.claude, ~/.codex) │
│ • Project (./.claude, ./.codex) │
└────────┬────────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 📝 Apply Configuration │
├─────────────────────────────────────┤
│ • Create/update config files │
│ • Set environment variables │
│ • Backup existing configs │
│ • Reload shell if needed │
└────────┬────────────────────────────┘
▼
┌─────────────────┐
│ ✅ Complete! │
└─────────────────┘
📦 Installation Options
🚀 Quick Run (Recommended)
# Latest version
npx megallm@latest
# Specific version
npx megallm@1.0.0
💻 Global Installation
# Install globally
npm install -g megallm
# Run from anywhere
megallm
🪟 Windows PowerShell
# Clear cache if needed
npm cache clean --force
# Run with explicit version
npx megallm@latest
# Alternative: Use CMD
cmd /c "npx megallm"
🔧 Configuration Details
Configuration Levels
Level | Claude Code | Codex/Windsurf | Scope |
---|---|---|---|
System | ~/.claude/settings.json |
~/.codex/config.toml |
All projects |
Project | ./.claude/settings.json |
./.codex/config.toml |
Current project only |
What Gets Configured
Claude Code (JSON) | Codex/Windsurf (TOML) |
---|---|
{
"env": {
"ANTHROPIC_BASE_URL": "https://ai.megallm.io",
"ANTHROPIC_API_KEY": "your-key"
},
"customApiKeyResponses": {
"approved": ["last-20-chars"]
}
} |
|
🚦 Setup Flow
Step 1: Get Your API Key
🔐 API Key Creation Process
┌──────────────────────────────────────────────────────┐
│ User runs: npx megallm │
└───────────────────────┬──────────────────────────────┘
▼
┌──────────────────────────────────────────────────────┐
│ Tool asks: "Do you have an API key?" │
└───────┬───────────────────────────────────┬──────────┘
▼ ▼
[No Key] [Has Key]
│ │
▼ ▼
┌──────────────────┐ ┌────────────────────┐
│ 🌐 Browser Opens │ │ 📝 Enter API Key │
│ megallm.io │ └─────────┬──────────┘
└────────┬─────────┘ │
▼ │
┌──────────────────┐ │
│ Create Account │ │
│ Generate API Key │ │
└────────┬─────────┘ │
▼ │
┌──────────────────┐ │
│ Copy API Key │ │
└────────┬─────────┘ │
▼ ▼
┌──────────────────────────────────────────────────────┐
│ ✅ API Key Validated & Saved │
└──────────────────────────────────────────────────────┘
📋 Quick Steps:
- No API Key? → Tool opens megallm.io automatically
- Sign up → Create your account (free tier available)
- Generate → Click "Create New API Key"
- Copy → Copy your key to clipboard
- Paste → Return to terminal and paste your key
- Done → Tool validates and saves your configuration
Step 2: Choose Your Configuration
Question | Options | Result |
---|---|---|
Which tool? | Claude Code / Codex / Both | Configures selected tools |
Setup level? | System / Project | Determines config location |
Confirm? | Yes / No | Applies configuration |
📋 Prerequisites
Before running the setup tool, ensure you have installed:
Claude CodeDesktop AI coding assistant |
Codex/WindsurfAI-powered code editor |
🛠️ Advanced Usage
Environment Variables
# Enable debug output
DEBUG=* npx megallm
# Skip welcome banner
NO_BANNER=1 npx megallm
# Combine options
DEBUG=* NO_BANNER=1 npx megallm
Manual Configuration
If you prefer manual setup, edit these files directly:
Claude Code Configuration
Location: ~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://ai.megallm.io",
"ANTHROPIC_API_KEY": "your-api-key-here"
},
"customApiKeyResponses": {
"approved": ["last-20-chars-of-key"],
"rejected": []
}
}
Codex/Windsurf Configuration
Location: ~/.codex/config.toml
[api]
base_url = "https://ai.megallm.io"
api_key = "your-api-key-here"
provider = "custom"
[auth]
provider = "custom"
endpoint = "https://ai.megallm.io"
api_key = "your-api-key-here"
🐛 Troubleshooting
Tool Not Detected
- Ensure Claude Code or Codex is installed
- Check configuration directories exist:
- Claude:
~/.claude/
- Codex:
~/.codex/
- Claude:
- Try restarting your terminal
Configuration Not Applied
- Restart your terminal/shell
- For project configs, verify you're in the right directory
- Check file permissions:
ls -la ~/.claude/
or~/.codex/
API Key Issues
- Verify key is valid at megallm.io
- Check for extra spaces or characters
- Ensure key has proper permissions
- Try regenerating the key if needed
📚 Documentation
🤝 Contributing
We welcome contributions! Here's how to get started:
# Fork and clone
git clone https://github.com/yourusername/megallm-npm
cd megallm-npm
# Install dependencies
npm install
# Make changes and test
npm start
# Submit PR
git push origin feature/your-feature
💬 Support
Channel | Link |
---|---|
support@megallm.io | |
🐛 Issues | GitHub Issues |
💬 Discord | Join Community |
📚 Docs | Documentation |
📄 License
MIT License - see LICENSE file for details.