Skip to main content
Cline is a powerful VSCode extension that combines AI assistance with terminal integration, autonomous task execution, and advanced context awareness. Configure it to use MegaLLM for access to multiple AI models.

Quick Configuration

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: 200000 tokens
  • Temperature: 0.5
4

Enable Features

  • Auto Context Detection
  • File Watcher
  • Terminal Integration
  • Git Integration
Configuration in settings.json:
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

  1. Open VSCode
  2. Go to Extensions: Ctrl+Shift+X / Cmd+Shift+X
  3. Search: Cline
  4. Click Install
  5. Reload VSCode if prompted
2

Get MegaLLM API Key

  1. Visit MegaLLM Dashboard
  2. Navigate to API Keys section
  3. Click Create New Key
  4. Copy the key (starts with sk-mega-)
3

Configure Cline

Open Command Palette and run: Cline: Open SettingsChoose your preferred format:For Claude Models:
For GPT Models:
4

Open Cline Panel

  1. Click Cline icon in left sidebar
  2. Or: Ctrl+Shift+PCline: Open
  3. 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:
  1. Analyze current auth code
  2. Run: npm install jsonwebtoken
  3. Create new JWT utilities
  4. Update login controller
  5. Create middleware
  6. Update routes
  7. Generate tests
  8. Update docs
You approve each file change before it’s written
4

Review and Commit

Result: Complete authentication refactor with minimal manual work!

Scenario 3: Project-Specific Cline Configuration

Different projects need different Cline setups: Python Data Analysis Project: .vscode/settings.json:
React/TypeScript Web App: .vscode/settings.json:
Rust Systems Project: .vscode/settings.json:

Scenario 4: Terminal Integration Workflow

Use Cline’s terminal powers for DevOps tasks: Configuration:
Example Workflow:

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
Migration Steps:
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 Comparison:

Scenario 6: Multi-Model Strategy

Switch models based on task complexity: Configuration:
Usage Pattern:
Switch profiles:
  1. In Cline panel, click model name
  2. Select profile from dropdown
  3. 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

Verification

Test 1: Basic Chat

  1. Open Cline panel in VSCode
  2. Start new session
  3. Type: What model are you using?
  4. Should respond with model name and MegaLLM confirmation

Test 2: Code Explanation

  1. Select a function in your code
  2. In Cline: /explain
  3. Should provide detailed explanation

Test 3: Terminal Integration

  1. In Cline: List all files in current directory
  2. Cline should suggest: ls -la
  3. Approve execution
  4. Should see file listing

Test 4: Multi-File Task

  1. Request: Add error handling to all API routes
  2. Cline analyzes multiple files
  3. Shows proposed changes for each
  4. Approve and apply

Test 5: Status Check

Run command: /status Should show:

Troubleshooting

Symptoms:
  • Messages sent but no response
  • “Model initialization failed” error
  • Connection timeout
Solutions:
  1. Check API provider configuration:
  2. Verify model is available:
  3. Check model name is correct:
    • claude-sonnet-4
    • claude-sonnet-3 (old version)
    • gpt-5
    • gpt-5.0 (wrong format)
  4. Reset Cline:
    • Command Palette: Cline: Reset Configuration
    • Restart VSCode
    • Reconfigure from scratch
Symptoms:
  • Cline suggests commands but doesn’t execute
  • “Terminal integration disabled” message
Solutions:
  1. Enable terminal integration:
  2. Check terminal permissions:
    • VSCode Settings → search “terminal allow”
    • Enable: Terminal > Integrated: Allow Workspace Configuration
  3. Verify allowed commands:
  4. Test manually:
    • Open VSCode terminal
    • Try running commands directly
    • Ensure terminal works before using Cline
Symptoms:
  • “Context too large” error
  • Cline can’t include all files
Solutions:
  1. Reduce context window:
  2. Limit files included:
  3. Be more specific: Instead of: “Review the entire project” Say: “Review only the auth module”
  4. Use smaller model:
Symptoms:
  • Cline keeps iterating without progress
  • Task never completes
  • Same errors repeating
Solutions:
  1. Limit max iterations:
  2. Require more approvals:
  3. Stop and restart:
    • Click “Stop” button in Cline panel
    • Review what Cline attempted
    • Provide more specific instructions
  4. Break down task: Instead of: “Refactor entire authentication system” Try: “First, just update the login endpoint to use JWT”
Symptoms:
  • “Invalid API key” error
  • 401 Unauthorized
  • Connection refused
Solutions:
  1. Verify key in environment:
  2. Reload VSCode:
    • Close all VSCode windows
    • Reload shell: source ~/.bashrc
    • Reopen VSCode
  3. Set key directly (testing):
  4. Test key manually:
  5. Check key is active:
    • Login to Dashboard
    • Verify key not revoked/expired
Symptoms:
  • Multiple AI suggestions appearing
  • Keyboard shortcuts not working
  • Performance issues
Solutions:
  1. Disable conflicting extensions:
  2. Check for keybinding conflicts:
    • File → Preferences → Keyboard Shortcuts
    • Search for Cline commands
    • Resolve any conflicts
  3. 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.json

Approval 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:
Usage: Type /deploy in Cline chat

Context Awareness

Improve Cline’s understanding:

Git Integration

Let Cline manage git workflows:

Next Steps

Kilocode Setup

Configure Kilocode for code completion

RooCode Setup

Configure RooCode standalone app

Models Catalog

Browse all available models

Other Agents

View all CLI and GUI agents

API Reference

Explore the API docs

Discord Community

Join for support