Quick Configuration
- Anthropic Format (Claude)
- OpenAI Format (GPT)
- Environment Variables
Configure for Claude Models
1
Open Cline Settings
- Press
Ctrl+Shift+P/Cmd+Shift+P - Type:
Cline: Open Settings - Or:
Settings → Extensions → Cline
2
Select API Provider
- API Provider: Select
Anthropic - Base URL:
https://ai.megallm.io - API Key:
sk-mega-your-api-key-here
3
Choose Claude Model
- Default Model:
claude-sonnet-4 - Context Window:
200000tokens - Temperature:
0.5
4
Enable Features
- Auto Context Detection
- File Watcher
- Terminal Integration
- Git Integration
Note: For Anthropic format, baseURL should be
https://ai.megallm.io (without /v1)Scenario Examples
Scenario 1: First-Time Installation
Complete setup from scratch:1
Install Cline Extension
- Open VSCode
- Go to Extensions:
Ctrl+Shift+X/Cmd+Shift+X - Search:
Cline - Click Install
- Reload VSCode if prompted
2
Get MegaLLM API Key
- Visit MegaLLM Dashboard
- Navigate to API Keys section
- Click Create New Key
- Copy the key (starts with
sk-mega-)
3
Configure Cline
Open Command Palette and run: For GPT Models:
Cline: Open SettingsChoose your preferred format:For Claude Models:4
Open Cline Panel
- Click Cline icon in left sidebar
- Or:
Ctrl+Shift+P→Cline: Open - Should see connection status: ✓ Connected
5
Test Configuration
In Cline chat, type:Expected Response:
Scenario 2: Autonomous Task Execution
Use Cline for complex, multi-step tasks: Scenario: “Refactor the authentication module to use JWT tokens”1
Configure for Autonomous Mode
2
Give Task to Cline
Open Cline panel and provide detailed instructions:
3
Cline Executes Autonomously
Cline will:
- Analyze current auth code
- Run:
npm install jsonwebtoken - Create new JWT utilities
- Update login controller
- Create middleware
- Update routes
- Generate tests
- Update docs
4
Review and Commit
Scenario 3: Project-Specific Cline Configuration
Different projects need different Cline setups: Python Data Analysis Project:.vscode/settings.json:
.vscode/settings.json:
.vscode/settings.json:
Scenario 4: Terminal Integration Workflow
Use Cline’s terminal powers for DevOps tasks: Configuration:Scenario 5: Migration from GitHub Copilot Chat
Switch from Copilot Chat to Cline with MegaLLM: Why Migrate:- Access to Claude (better reasoning) AND GPT
- Terminal integration (Copilot Chat doesn’t have)
- Autonomous multi-step tasks
- Better pricing (pay-per-use vs seat-based)
- More context awareness
1
Document Current Usage
Note your favorite Copilot Chat features:
- Explaining code
- Generating functions
- Writing tests
- Debugging help
2
Disable Copilot Chat
3
Install Cline
VSCode Extensions → Search “Cline” → Install
4
Configure with MegaLLM
5
Learn Cline Commands
/explain- Explain selected code/test- Generate tests/fix- Debug and fix issues/refactor- Refactor code/task- Execute multi-step task
6
Compare Experience
Advantages over Copilot Chat:
- Can execute terminal commands
- Better at multi-file changes
- Claude Opus for complex reasoning
- Can run tests and verify changes
- Git integration built-in
| Feature | Copilot Chat | Cline + MegaLLM |
|---|---|---|
| Chat Interface | ||
| Code Explanation | Better with Claude | |
| Code Generation | ||
| Terminal Execution | ||
| Multi-File Edit | Limited | Extensive |
| Model Choice | GPT-4 only | GPT, Claude, Gemini |
| Autonomous Tasks | ||
| Git Integration | Basic | Advanced |
| Pricing | $10-20/month | Pay-per-use |
Scenario 6: Multi-Model Strategy
Switch models based on task complexity: Configuration:- In Cline panel, click model name
- Select profile from dropdown
- Or use command:
/model powerful
Scenario 7: CI/CD Integration
Use Cline in automated workflows: GitHub Actions Example:.github/workflows/cline-review.yml:
Configuration Options
Complete Reference
Model Selection Guide
| Task | Recommended Model | API Provider | Why |
|---|---|---|---|
| Code Review | claude-sonnet-4 | Anthropic | Excellent analysis |
| Refactoring | claude-opus-4-1-20250805 | Anthropic | Best reasoning |
| Quick Tasks | gpt-4o-mini | OpenAI | Fastest |
| Web Development | gpt-5 | OpenAI | Great for JS/React |
| Documentation | gpt-5 | OpenAI | Clear writing |
| Systems Code | gemini-2.5-pro | OpenAI | Precise logic |
| Autonomous Tasks | claude-opus-4-1-20250805 | Anthropic | Complex reasoning |
Verification
Test 1: Basic Chat
- Open Cline panel in VSCode
- Start new session
- Type:
What model are you using? - Should respond with model name and MegaLLM confirmation
Test 2: Code Explanation
- Select a function in your code
- In Cline:
/explain - Should provide detailed explanation
Test 3: Terminal Integration
- In Cline:
List all files in current directory - Cline should suggest:
ls -la - Approve execution
- Should see file listing
Test 4: Multi-File Task
- Request:
Add error handling to all API routes - Cline analyzes multiple files
- Shows proposed changes for each
- Approve and apply
Test 5: Status Check
Run command:/status
Should show:
Troubleshooting
Model not responding
Model not responding
Symptoms:
- Messages sent but no response
- “Model initialization failed” error
- Connection timeout
-
Check API provider configuration:
-
Verify model is available:
-
Check model name is correct:
claude-sonnet-4claude-sonnet-3(old version)gpt-5gpt-5.0(wrong format)
-
Reset Cline:
- Command Palette:
Cline: Reset Configuration - Restart VSCode
- Reconfigure from scratch
- Command Palette:
Terminal commands not executing
Terminal commands not executing
Symptoms:
- Cline suggests commands but doesn’t execute
- “Terminal integration disabled” message
-
Enable terminal integration:
-
Check terminal permissions:
- VSCode Settings → search “terminal allow”
- Enable:
Terminal > Integrated: Allow Workspace Configuration
-
Verify allowed commands:
-
Test manually:
- Open VSCode terminal
- Try running commands directly
- Ensure terminal works before using Cline
Context window exceeded
Context window exceeded
Symptoms:
- “Context too large” error
- Cline can’t include all files
-
Reduce context window:
-
Limit files included:
- Be more specific: Instead of: “Review the entire project” Say: “Review only the auth module”
-
Use smaller model:
Autonomous mode stuck
Autonomous mode stuck
Symptoms:
- Cline keeps iterating without progress
- Task never completes
- Same errors repeating
-
Limit max iterations:
-
Require more approvals:
-
Stop and restart:
- Click “Stop” button in Cline panel
- Review what Cline attempted
- Provide more specific instructions
- Break down task: Instead of: “Refactor entire authentication system” Try: “First, just update the login endpoint to use JWT”
API key not recognized
API key not recognized
Symptoms:
- “Invalid API key” error
- 401 Unauthorized
- Connection refused
-
Verify key in environment:
-
Reload VSCode:
- Close all VSCode windows
- Reload shell:
source ~/.bashrc - Reopen VSCode
-
Set key directly (testing):
-
Test key manually:
-
Check key is active:
- Login to Dashboard
- Verify key not revoked/expired
Conflicts with other extensions
Conflicts with other extensions
Symptoms:
- Multiple AI suggestions appearing
- Keyboard shortcuts not working
- Performance issues
-
Disable conflicting extensions:
-
Check for keybinding conflicts:
- File → Preferences → Keyboard Shortcuts
- Search for Cline commands
- Resolve any conflicts
-
Try one extension at a time:
- Disable all AI extensions
- Enable only Cline
- Test functionality
- Re-enable others one by one
Best Practices
Use Environment Variables
Keep API keys in env vars:
${env:MEGALLM_API_KEY}Project-Specific Config
Different models per project in
.vscode/settings.jsonApproval for Terminal
Always require approval for terminal commands
Start Small
Test autonomous mode on small tasks first
Monitor Context
Watch context usage to avoid hitting limits
Git Integration
Let Cline handle git operations for you
Advanced Tips
Custom Slash Commands
Create shortcuts for common tasks:/deploy in Cline chat

