Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>opencode (inofficial)New to Visual Studio Code? Get it now.
opencode (inofficial)

opencode (inofficial)

Bas Steins

|
1 install
| (0) | Free
AI-powered coding assistant with unified model selection across multiple providers. Get code explanations, bug detection, improvements, and complexity analysis through an intuitive interface.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

opencode VS Code Extension

opencode is a powerful Visual Studio Code extension that connects to opencode server to provide AI-powered code assistance, explanations, and improvements. Get instant help with your code using state-of-the-art language models from various providers.

opencode Extension

✨ Features

🤖 AI-Powered Code Assistance

  • Code Explanation: Get detailed explanations of selected code blocks
  • Bug Detection: Hunt for potential bugs and issues in your code
  • Code Improvement: Receive suggestions for optimizing and improving code
  • Time Complexity: Analyze the computational complexity of algorithms

🔌 Multi-Provider Support

  • Flexible Providers: Support for OpenAI, Anthropic, Google, Cohere, and more
  • Auto-Detection: Automatically discover and configure available providers
  • Unified Model Selection: Choose from hundreds of models across all providers in one dropdown
  • Smart Auto-Selection: Intelligent provider and model selection based on availability
  • Mode Configuration: Use specialized modes for different coding tasks

💬 Interactive Chat Interface

  • Sidebar Chat: Dedicated chat panel for ongoing conversations
  • Interactive Model Selection: Click-to-select any model from any provider
  • Real-time Model Switching: Instantly switch models with visual feedback
  • Smart Model Management: Favorites, history, and intelligent sorting
  • Rich Formatting: Markdown support for code blocks and formatting
  • Conversation History: Maintain context across multiple interactions
  • Performance Optimized: Virtual scrolling for 100+ models, instant search
  • Accessibility: Full keyboard navigation and screen reader support

⚙️ Advanced Configuration

  • Connection Testing: Built-in tools to test and validate connections
  • Configuration Validation: Automatic validation with helpful recommendations
  • Provider Discovery: Browse available providers and models
  • Smart Defaults: Intelligent fallback to optimal configurations

🚀 Quick Start

Prerequisites

  1. opencode Server: You need access to an opencode server. The default configuration expects a server running at http://127.0.0.1:4096

  2. Provider Setup: Ensure your opencode server has at least one provider configured (OpenAI, Anthropic, etc.)

Installation

  1. Install the extension from the VS Code Marketplace or from a .vsix file
  2. Open VS Code and look for the opencode icon in the Activity Bar
  3. The extension will automatically validate your configuration on startup

Basic Usage

  1. Select Code: Highlight any code block in your editor
  2. Open Command Palette: Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  3. Choose Action: Select one of the opencode commands:
    • opencode: Explain selected codeblock
    • opencode: Find bugs in selected codeblock
    • opencode: Suggest improvements for selected codeblock
    • opencode: Time complexity for selected codeblock
  4. View Results: The response will appear in the opencode chat panel

🎛️ Interactive Model Selection

🎉 Fully Interactive Model Switching!

The extension features a powerful, interactive model selection system:

Unified Model Dropdown

  • Click-to-Select: Simply click any model to switch instantly
  • Cross-Provider: Choose from hundreds of models across all providers
  • Visual Feedback: Immediate confirmation with notifications and animations
  • Real-time Updates: Changes apply instantly to new conversations

Advanced Search & Filtering

  • Instant Search: Type to filter models by name, provider, or capabilities
  • Keyboard Shortcuts: Press / or Ctrl+F to focus search
  • Smart Filtering: Search across model names, providers, and descriptions
  • Performance: Virtual scrolling handles 100+ models smoothly

Favorites & History

  • Star Models: Click ⭐ to favorite frequently used models
  • Recent Models: See 🕐 indicators for recently used models
  • Smart Sorting: Favorites first, then recent, then alphabetical
  • Filter View: Toggle "Favorites Only" mode for focused selection

Keyboard Navigation

  • Full Accessibility: Complete keyboard support for all features
  • Quick Actions: Use 1-9 keys for rapid selection of first 9 models
  • Navigation: Arrow keys, Page Up/Down, Home/End for browsing
  • Global Shortcut: Ctrl+Shift+M (Cmd+Shift+M) to toggle dropdown

Professional UX

  • Smooth Transitions: Elegant animations and progress indicators
  • Rich Tooltips: Detailed model information on hover
  • Status Notifications: Toast messages for selection feedback
  • Error Handling: Graceful fallbacks and clear error messages

⌨️ Keyboard Shortcuts

OpenCode includes powerful keyboard shortcuts for efficient model selection:

Model Selection

Shortcut Action
Ctrl+Shift+M (Cmd+Shift+M) Toggle model dropdown
↑ / ↓ Navigate up/down in model list
Page Up / Page Down Jump by 10 models
Home / End Jump to first/last model
Enter / Space Select highlighted model
Escape Close dropdown
1-9 Quick select first 9 models

Search & Filter

Shortcut Action
/ Focus search input
Ctrl+F (Cmd+F) Focus search input
Escape Clear search and close

Chat Interface

Shortcut Action
Ctrl+Enter (Cmd+Enter) Send message
Shift+Enter New line in message

⚙️ Configuration

Basic Settings

Configure opencode through VS Code settings (Cmd/Ctrl + ,):

{
  "opencode.endpoint": "http://127.0.0.1:4096",
  "opencode.provider": "openai",
  "opencode.model": "gpt-4",
  "opencode.mode": "build",
  "opencode.history": 5,
  "opencode.systemPrompt": "You are a helpful coding assistant..."
}

Configuration Options

Setting Description Default
opencode.endpoint opencode server URL http://127.0.0.1:4096
opencode.provider AI provider to use "" (auto-detect)
opencode.model Specific model to use "" (auto-detect)
opencode.mode opencode mode for specialized tasks "build"
opencode.history Number of previous messages to include 5
opencode.systemPrompt Custom system prompt for conversations Default assistant prompt
opencode.autoSelectModel Automatically select best available model true
opencode.showModelDetails Show detailed model information in tooltips true
opencode.enableKeyboardShortcuts Enable keyboard shortcuts for model selection true
opencode.maxHistoryItems Maximum number of models in history 10
opencode.enableNotifications Show status notifications for model changes true

💡 Note: provider and model settings are automatically updated when you select models through the interactive dropdown.

Auto-Detection & Interactive Model Selection

💡 New in v1.0.0: Fully Interactive Model Selection

The extension now features a complete interactive model selection system:

  1. Open Chat Panel: Click the opencode icon in the Activity Bar
  2. Click Model Dropdown: Interactive dropdown shows all available models
  3. Select Any Model: Click any model to switch instantly - no settings required
  4. Automatic Configuration: Your selection is automatically saved to VS Code settings
  5. Cross-Provider: Switch between any provider seamlessly
  6. Persistent: Selections survive VS Code restarts and sync across devices

Getting Started with Model Selection

  • First Time: Extension auto-selects the best available model
  • Switching Models: Click dropdown → click model → start chatting
  • Favorites: Star frequently used models for quick access
  • Search: Type to find specific models from 100+ options
  • Keyboard: Use Ctrl+Shift+M for quick dropdown access

Advanced Features

  • Model History: Recently used models appear at the top
  • Smart Sorting: Favorites, recent, then alphabetical organization
  • Performance: Virtual scrolling handles large model lists efficiently
  • Accessibility: Full keyboard navigation and screen reader support

Traditional Configuration

If you leave provider or model empty, opencode will automatically:

  • Discover available providers on your server
  • Select the best available model from any provider
  • Use intelligent defaults based on your server configuration
  • Present all options in the unified model dropdown for manual selection

🛠️ Management Commands

opencode provides several commands for managing your setup:

Connection & Validation

  • opencode: Test Connection: Test connectivity to your opencode server
  • opencode: Validate Configuration: Check your current configuration for issues
  • opencode: Show Configuration Recommendations: Get intelligent suggestions for optimal setup

Discovery & Information

  • opencode: Show Available Providers: Browse all providers on your server
  • opencode: Show Available Models: View all available AI models
  • opencode: Show Available Modes: See specialized modes for different tasks
  • opencode: Show Current Configuration: Display your current settings

Chat Management

  • opencode: Open Chat: Open the interactive chat panel with model selection
  • opencode: Restart Chat: Clear conversation history and start fresh
  • opencode: Refresh Models: Reload available models from the server
  • opencode: Reset Favorites: Clear all favorite model selections
  • opencode: Clear History: Remove model selection history

🔧 Troubleshooting

Common Issues

❌ Connection Failed

Problem: Cannot connect to opencode server

Solutions:

  1. Verify opencode server is running: curl http://127.0.0.1:4096/app
  2. Check firewall and network settings
  3. Confirm endpoint URL in settings
  4. Use opencode: Test Connection command

⚠️ No Providers Available

Problem: Server has no configured providers

Solutions:

  1. Configure at least one provider on your opencode server
  2. Check provider API keys and credentials
  3. Use opencode: Show Available Providers to verify setup

🔧 Configuration Issues

Problem: Invalid provider or model configuration

Solutions:

  1. Use opencode: Validate Configuration for detailed analysis
  2. Use opencode: Show Configuration Recommendations for suggestions
  3. Set provider/model to empty string for auto-detection

Advanced Troubleshooting

Check Server Status

# Test basic connectivity
curl http://127.0.0.1:4096/app

# List available providers
curl http://127.0.0.1:4096/config/providers

# List available modes
curl http://127.0.0.1:4096/mode

Reset Configuration

  1. Open VS Code settings
  2. Search for "opencode"
  3. Reset problematic settings to defaults
  4. Restart VS Code
  5. Use opencode: Show Configuration Recommendations

Debug Mode

Enable debug logging by adding to your VS Code settings:

{
  "opencode.debug": true
}

Getting Help

  1. Built-in Commands: Use validation and recommendation commands
  2. Status Display: Check the status bar in the chat window
  3. Error Messages: Read detailed error messages with suggested actions
  4. Server Logs: Check your OpenCode server logs for additional details

🎯 Best Practices

Optimal Configuration

  • Use specific provider/model combinations for consistent results
  • Configure appropriate history length for your use case
  • Customize system prompts for specialized domains

Efficient Usage

  • Select relevant code blocks for better context
  • Use different modes for different types of tasks
  • Restart chat periodically to clear context

Performance Tips

  • Test connection regularly if using remote servers
  • Monitor provider usage and rate limits
  • Use auto-detection for dynamic environments

📝 Examples

Basic Code Explanation

  1. Select this Python function:
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
  1. Run OpenCode: Explain selected codeblock
  2. Get detailed explanation of the recursive Fibonacci implementation

Bug Detection

  1. Select problematic code
  2. Run OpenCode: Find bugs in selected codeblock
  3. Receive analysis of potential issues and fixes

Performance Analysis

  1. Select an algorithm
  2. Run OpenCode: Time complexity for selected codeblock
  3. Get Big-O notation analysis and optimization suggestions

🔄 Updates & Migration

This extension has been migrated from legacy systems to work with OpenCode servers instead of local installations. Key improvements include:

  • Multi-provider support instead of single backend
  • Enhanced error handling with actionable suggestions
  • Real-time status indicators for connection and configuration
  • Comprehensive validation tools for easier setup
  • Rich UI enhancements for better user experience

📄 License

This project is licensed under the GPLv3 License with Commons Clause - see the LICENSE file for details.

Notable Mentions

  • OpenCode
  • Ollacode - This extension is inspired by Vincent van Dam's work on Ollacode
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft