Quick Install
The fastest way to get started - no installation required:
This runs the latest version directly without installing anything permanently.
Installation Methods
Method 1: NPX (Recommended)
Run directly without installation:
Advantages:
No installation required
Always uses the latest version
No disk space used
Perfect for one-time or occasional use
Usage:
# Run latest version
npx megallm@latest
# Run specific version
npx megallm@2.5.9
# With environment variables
NO_BANNER = 1 npx megallm@latest
Method 2: Global Installation
Install once, use anytime:
Then run with:
Advantages:
Faster startup (already installed)
Works offline (after initial install)
Shorter command
Good for frequent use
Update:
Uninstall:
Method 3: Local Project Installation
Install as a project dependency:
npm install --save-dev megallm
Add to package.json scripts:
{
"scripts" : {
"setup-megallm" : "megallm"
}
}
Run with:
Best for:
Team projects with standardized setup
Version-locked installations
CI/CD pipelines
System Requirements
Required
Node.js 18.0.0 or higher is required to run the MegaLLM CLI
Check your Node.js version:
If you need to install or update Node.js:
Using Homebrew: Using nvm (recommended): curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18
Official Installer:
Download from nodejs.org
Platform Status Notes macOS Fully SupportedIntel & Apple Silicon Linux Fully SupportedAll major distributions Windows Fully SupportedNative & WSL
Supported Shells
Shell Status Platform bash Fully SupportedAll platforms zsh Fully SupportedmacOS, Linux fish Fully SupportedmacOS, Linux PowerShell Fully SupportedWindows
Verification
After installation, verify everything works:
# Check Node.js version
node --version
# Should show: v18.0.0 or higher
# Check npm version
npm --version
# Should show: 9.0.0 or higher
# Run the CLI
npx megallm@latest --version
# or if installed globally:
megallm --version
Permissions
macOS/Linux
The CLI needs write permissions to:
~/.claude/ - Claude Code configuration
~/.codex/ - Codex configuration
~/.config/opencode/ - OpenCode configuration
~/.bashrc, ~/.zshrc, etc. - Shell configuration files
If you encounter permission errors:
# Fix ownership
sudo chown -R $USER ~/.claude ~/.codex ~/.config/opencode
# Fix permissions
chmod -R 755 ~/.claude ~/.codex ~/.config/opencode
Windows
Run your terminal as Administrator if you encounter permission issues.
The CLI can automatically install AI coding tools if they’re missing. Required permissions:
# NPM global install permission
npm install -g @anthropic-ai/claude-code
npm install -g @codeium/windsurf
npm install -g opencode
If you don’t have permission for global installs:
Option 1: Use npx
# Instead of installing globally, use npx
npx @anthropic-ai/claude-code
Option 2: Fix npm permissions
# macOS/Linux
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Troubleshooting Installation
Node.js isn’t installed or not in your PATH. Fix:
Install Node.js from nodejs.org
Restart your terminal
Verify: node --version
npm isn’t installed or is an old version. Fix: # Update npm
npm install -g npm@latest
# Or reinstall Node.js
You don’t have permission to install global packages. Fix: # macOS/Linux - Configure npm to use a different directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile
Or use sudo (not recommended): sudo npm install -g megallm
You’re running an old version. Fix: # Clear npm cache
npm cache clean --force
# Update to latest
npm update -g megallm
# Or run latest with npx
npx megallm@latest
npm can’t connect to the registry. Fix: # Check npm registry
npm config get registry
# Set registry
npm config set registry https://registry.npmjs.org/
# If behind a proxy
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Advanced Installation
Offline Installation
For environments without internet access:
Download on internet-connected machine:
npm pack megallm
# Creates: megallm-2.5.9.tgz
Transfer file to offline machine
Install from tarball:
npm install -g ./megallm-2.5.9.tgz
CI/CD Installation
For automated environments:
GitHub Actions
GitLab CI
Jenkins
- name : Setup Node.js
uses : actions/setup-node@v3
with :
node-version : '18'
- name : Run MegaLLM CLI
run : npx megallm@latest
env :
NO_BANNER : '1'
Docker Installation
Include in your Dockerfile:
FROM node:18
# Install megallm globally
RUN npm install -g megallm
# Or use npx
RUN npx megallm@latest --version
# Configure at runtime
CMD [ "megallm" ]
Version Management
Check Current Version
# If installed globally
megallm --version
# Using npx
npx megallm@latest --version
Install Specific Version
# Install specific version globally
npm install -g megallm@2.5.9
# Run specific version with npx
npx megallm@2.5.9
Version History
View all available versions:
npm view megallm versions
View latest version:
Uninstallation
Remove Global Installation
Remove Configuration Files
The CLI creates configuration files that persist after uninstallation:
# Remove all MegaLLM configurations
rm -rf ~/.claude/settings.json ~/.claude.json
rm -rf ~/.codex/config.toml
rm -rf ~/.config/opencode/opencode.json
# Remove environment variables
# Edit your shell config (~/.bashrc, ~/.zshrc, etc.)
# and remove lines containing:
# ANTHROPIC_BASE_URL
# ANTHROPIC_API_KEY
# MEGALLM_API_KEY
Complete Cleanup
To completely remove all traces:
# Uninstall CLI
npm uninstall -g megallm
# Remove config files
rm -rf ~/.claude ~/.codex ~/.config/opencode
# Remove project-level configs
rm -rf ./.claude ./opencode.json
# Clear npm cache
npm cache clean --force
Next Steps