Skip to main content

General Questions

The MegaLLM CLI is an interactive setup tool that configures AI coding assistants (Claude Code, Codex/Windsurf, and OpenCode) to use the MegaLLM AI service. It automates the configuration process, manages API keys securely, and provides a seamless setup experience across different platforms.
The CLI currently supports:
  • Claude Code - System-level and project-level configuration
  • Codex/Windsurf - System-level configuration only
  • OpenCode - System-level and project-level configuration
More tools may be added in future releases.
No! You can run it directly using npx:
However, you can also install it globally if you prefer:
  • Node.js: Version 18.0.0 or higher
  • Operating System: macOS, Linux, or Windows
  • Shell: bash, zsh, fish, or PowerShell
Check your Node.js version with: node --version

Installation & Setup

  1. Visit megallm.io/dashboard
  2. Sign up or log in to your account
  3. Navigate to the API Keys section
  4. Click “Create New API Key”
  5. Copy your API key (starts with sk-mega-)
  6. Save it securely - you won’t be able to see it again
The CLI can open this page for you automatically during setup.
System-Level (Global):
  • Applies to all projects on your machine
  • Stored in your home directory (~/.claude/, ~/.codex/, etc.)
  • Best for personal development environments
  • Easier to manage for single developers
Project-Level (Local):
  • Applies only to the current project directory
  • Stored in the project folder (./.claude/, ./opencode.json, etc.)
  • Best for team projects with shared configurations
  • Allows different API keys per project
  • Can be version-controlled (without exposing API keys)
Important: Codex/Windsurf only supports system-level configuration.
When running the CLI, you’ll be asked which tool to configure:
Selecting “Configure All” will set up all detected tools in sequence.Alternatively, run the CLI multiple times and select one tool each time.
Yes! If the CLI detects that a tool is not installed, it will offer to install it:
The CLI installs tools via NPM as global packages.

Configuration

Claude Code:
  • System: ~/.claude/settings.json, ~/.claude.json
  • Project: ./.claude/settings.json or ./.claude/settings.local.json
Codex/Windsurf:
  • System: ~/.codex/config.toml
OpenCode:
  • System: ~/.config/opencode/opencode.json
  • Project: ./opencode.json
Environment Variables:
  • bash: ~/.bashrc
  • zsh: ~/.zshrc
  • fish: ~/.config/fish/config.fish
  • PowerShell: PowerShell profile
The CLI will detect existing configurations and ask what you’d like to do:
Selecting “Override” will:
  1. Create backup files (.backup suffix)
  2. Remove old configuration
  3. Apply new configuration
Selecting “Skip” will keep your existing setup and exit.
Simply run the CLI again and choose “Override” when prompted about existing configuration:
The CLI will backup your old configuration before applying the new one.
Yes! Use project-level configuration:
Each project will have its own .claude/settings.json with its own API key.

Troubleshooting

The CLI checks for tools using these methods:
  1. NPM global package list
  2. Command availability in PATH
  3. Known installation directories
If detection fails:
  1. Ensure the tool is installed globally: npm list -g --depth=0
  2. Check if the command is available: which claude-code or which codex
  3. Restart your terminal
  4. Try installing manually: npm install -g @anthropic-ai/claude-code
This usually means you don’t have write access to the configuration directories.macOS/Linux Fix:
Windows Fix:
  • Run your terminal as Administrator
  • Or: Fix permissions in File Explorer → Properties → Security
Check 1: Environment Variables
If empty, reload your shell:
Check 2: Configuration Files
Verify the files exist and contain your API key.Check 3: File Permissions
Files should be readable by your user.
  1. Verify key format: Should start with sk-mega-
  2. Check for typos: Copy-paste the key directly from the dashboard
  3. Trim whitespace: Remove any spaces before/after the key
  4. Key length: Must be at least 20 characters
  5. Regenerate: Create a new API key at megallm.io/dashboard
Test your API key:
Remove Configuration Files:
Remove Environment Variables: Edit your shell config file (~/.bashrc, ~/.zshrc, etc.) and remove these lines:
Then reload: source ~/.bashrc or restart terminal.
Yes! Run in debug mode:
This will show detailed logs of:
  • System detection
  • Tool detection
  • File operations
  • Configuration changes
  • Error stack traces

Advanced Usage

Yes, but it’s better to configure manually in CI/CD environments:
This avoids interactive prompts and is more reliable in automated environments.
Add configuration during Docker build:
Or pass API key at runtime:
Yes, but carefully:DO commit:
  • Project-level configuration WITHOUT API keys
  • .claude/settings.json with only ANTHROPIC_BASE_URL
  • Documentation for team members
DON’T commit:
  • API keys
  • .claude/settings.local.json
  • Personal environment variables
Example .claude/settings.json for version control:
Add to .gitignore:
Team members add their own API key:
Yes! Each tool’s configuration file allows you to specify the model.Claude Code (~/.claude/settings.json):
Codex (~/.codex/config.toml):
OpenCode (~/.config/opencode/opencode.json):
See Models Catalog for available models.
The CLI creates backup files before modifying configurations:
Backups are created with the .backup suffix and contain your previous configuration.To restore from backup:
You can delete backups manually if you don’t need them:

Getting Help

Documentation:Support Channels:Community:
  1. Check existing issues: github.com/Megallm/megallm-npm/issues
  2. If not found, create a new issue with:
    • CLI version: npx megallm@latest --version
    • Node.js version: node --version
    • Operating system
    • Shell type
    • Error message/logs (run with DEBUG=*)
    • Steps to reproduce
Open a feature request on GitHub: github.com/Megallm/megallm-npm/issues/newInclude:
  • Description of the feature
  • Use case / why it’s needed
  • Any relevant examples or mockups

Still Have Questions?

Can’t find your answer? We’re here to help!

Email Support

Get help from our support team

GitHub Issues

Report bugs or request features

Discord Community

Chat with the community

Documentation

Browse complete documentation