惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
C
Check Point Blog
B
Blog RSS Feed
G
Google Developers Blog
H
Help Net Security
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Recent Announcements
Recent Announcements
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
DataBreaches.Net
小众软件
小众软件
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
T
Tailwind CSS Blog
J
Java Code Geeks
MyScale Blog
MyScale Blog
雷峰网
雷峰网
有赞技术团队
有赞技术团队
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
OpenCode's 5 Hidden Uses: The 178K-Star Terminal AI Agent...
· 2026-06-25 · via DEV Community

韩

What if your terminal AI agent could talk to 30+ LLM providers, run isolated background tasks, load custom plugins from npm, and authenticate to MCP servers — all from a single npm install?

OpenCode is a 178,218-star open source AI coding agent built in TypeScript. It crossed 1,274 points on Hacker News in March 2026, and its latest release (v1.17.10, June 24 2026) added MCP resource templates, OAuth-bound callbacks, and a new --mini CLI mode. Most developers use it as a Claude Code alternative in the terminal — but scratch the surface and you'll find a plugin ecosystem, multi-agent architecture, and provider abstraction that go far beyond autocomplete.

In 2026's landscape of AI coding tools, where Cursor, Claude Code, Codex CLI, and Goose all compete for developer mindshare, OpenCode stands out by being completely open source (MIT license), provider-agnostic (30+ providers including self-hosted), and built around an extensible plugin + skill + MCP architecture. Here are five hidden uses that most people miss.

Hidden Use #1: Multi-Provider Fallback with Custom Providers

What most people do: Use OpenCode with a single API key — Anthropic, OpenAI, or whatever they have.

The hidden trick: OpenCode's provider plugin system supports 30+ providers out of the box, including Anthropic, OpenAI, Google, DeepSeek, Mistral, Groq, TogetherAI, OpenRouter, GitHub Copilot, GitLab, Snowflake Cortex, and many more. You can configure multiple providers with different models and switch between them mid-session using the /model command. Even better, you can add custom OpenAI-compatible providers pointing to self-hosted models (Ollama, vLLM, LM Studio).

# Configure OpenCode with a custom provider for local Ollama
opencode config set providers.ollama.baseUrl "http://localhost:11434/v1"
opencode config set providers.ollama.models '[{"id":"llama3.3","name":"Llama 3.3 70B"}]'

# Switch between providers in-session
# Just type: /model ollama/llama3.3
# Or: /model anthropic/claude-sonnet-4-20250514

The result: Your coding agent becomes provider-agnostic. When Anthropic rate-limits you, switch to DeepSeek. When you need a cheap model for exploration, use Groq. When you need to run on-prem, point to your Ollama instance — all without leaving the session.

Data sources: OpenCode GitHub 178,218 Stars, HN 1,274 pts/618 comments (story 47460525), 30+ provider plugins confirmed from repo tree (packages/core/src/plugin/provider/*.ts).

Hidden Use #2: Plugin Ecosystem — npm Packages as Agent Extensions

What most people do: Use OpenCode as-is, with its built-in features.

The hidden trick: OpenCode has a full plugin system. You can install plugins from npm packages, load custom ones from directories, or write your own. Plugins can add custom agents, commands, providers, and even inject system context. The plugin lifecycle supports installation, loading, hot-reloading, and sandboxing.

# Install a plugin from npm
opencode plugin install @my-org/opencode-custom-agent

# Load a local plugin from a directory
opencode --plugin ./my-custom-plugin/

# List installed plugins
opencode plugin list

Plugins are written in TypeScript and can register:

  • Custom agents (with their own system prompts and tool sets)
  • Custom slash commands (e.g., /review-pr, /deploy-staging)
  • Custom LLM providers (pointing to any OpenAI-compatible API)
  • Custom tools (via MCP server integration)

The result: You can extend OpenCode with domain-specific capabilities — a /run-migrations command that knows your database schema, a code-review agent tuned to your team's conventions, or a deployment plugin that wraps your CI/CD pipeline.

Data sources: OpenCode v1.17.10 release notes (2026-06-24), plugin system confirmed in repo tree (packages/plugin/src/v2/, packages/core/src/plugin/).

Hidden Use #3: MCP OAuth — Authenticated Tool Use with External Services

What most people do: Use MCP servers with either no auth or static API keys pasted into config.

The hidden trick: OpenCode supports full MCP OAuth flows. When you connect to an MCP server that requires OAuth (e.g., GitHub, Slack, Jira), OpenCode opens a browser-based OAuth flow, handles the callback on an IPv4 loopback server (bound for security in v1.17.10), and manages token refresh automatically. This means you can use GitHub's MCP server to create issues, read PRs, and manage repositories — all through natural language in your terminal.

# Add an MCP server with OAuth support
opencode mcp add github --url https://api.github.com/mcp

# OpenCode will prompt OAuth login in browser
# After auth, you can say:
# "Create a PR from my current branch to main with title 'Fix auth bug'"
# "List all open issues assigned to me"

The result: Your terminal agent becomes a bridge to external services with proper authentication. No more pasting tokens into config files — OAuth handles it securely with automatic refresh.

Data sources: OpenCode v1.17.10 release notes — "Bound MCP OAuth callbacks to IPv4 loopback for better local auth reliability" (@he-yufeng), MCP auth system confirmed in packages/opencode/src/mcp/auth.ts.

Hidden Use #4: Background Sub-Agents and the Plan/Build Architecture

What most people do: Use OpenCode's default "build" agent for everything.

The hidden trick: OpenCode ships with two built-in agents: build (full access, default) and plan (read-only, asks permission before running commands). You switch between them with the Tab key. The plan agent is perfect for exploring unfamiliar codebases, analyzing architecture, or planning refactors — without risk of accidental edits. Additionally, OpenCode supports background sub-agents that run in parallel. You can spawn a @general sub-agent for complex searches while continuing to code in the main session.

# Start OpenCode
opencode

# Press Tab to switch between build and plan agents
# In plan agent: "Analyze the authentication flow in this codebase"
# In build agent: "Refactor the auth module to use the new token format"

# Spawn a sub-agent for background work
# Type: @general search for all TODO items related to error handling
# Continue coding while sub-agent works

The result: The plan agent acts as a safe exploration mode — you can hand it to a junior developer or use it in CI pipelines where you want analysis without modifications. Background sub-agents let you parallelize research and coding, effectively turning your terminal into a multi-agent workspace.

Data sources: OpenCode README (dev branch) — "build agent (full-access) / plan agent (read-only, asks permission)", HN 319pts story "Opencode: AI coding agent, built for the terminal" (id 44482504).

Hidden Use #5: Skills System — Reusable Prompt Templates as Code

What most people do: Type the same instructions repeatedly ("write tests", "review this PR", "check for security issues").

The hidden trick: OpenCode has a built-in skills system. Skills are markdown files (.md) stored in .opencode/skills/ that define reusable prompt templates. You can invoke them with /skill-name, and they support frontmatter configuration for customization. OpenCode ships with built-in skills like customize-opencode and effect, and you can create your own.

# .opencode/skills/review-security.md
---
name: review-security
description: "Security-focused code review"
tools: [read, list, grep]
---

Review the current file for security vulnerabilities:
1. Check for SQL injection patterns
2. Look for hardcoded secrets or API keys
3. Verify input validation on all user-facing endpoints
4. Flag any use of eval() or dynamic imports

# Invoke the custom skill
/review-security

# Or use built-in skills
/customize-opencode  # OpCode's own configuration wizard

The result: Skills turn repeated instructions into shareable, version-controlled templates. Your team can maintain a library of skills in the repo, and every developer on the team gets the same consistent behavior — no more copy-pasting prompts or forgetting steps in code reviews.

Data sources: OpenCode repo tree — .opencode/skills/effect/SKILL.md, packages/core/src/skill/*, packages/opencode/src/skill/discovery.ts, v1.17.10 release notes mentioning skill base directories.


Summary: 5 Hidden Uses of OpenCode

  1. Multi-Provider Fallback — Switch between 30+ LLM providers mid-session, including self-hosted models
  2. Plugin Ecosystem — Extend the agent with npm packages, custom agents, and domain-specific commands
  3. MCP OAuth — Authenticate to external services (GitHub, Slack, Jira) via browser-based OAuth flows
  4. Plan/Build Architecture — Use read-only plan agents for safe exploration and background sub-agents for parallel work
  5. Skills System — Create reusable, version-controlled prompt templates for consistent team workflows

Previously on This Series

If you enjoyed this article, check out previous entries in the "5 Hidden Uses" series:


Have you discovered a hidden use for OpenCode — a plugin, skill, or workflow that most people don't know about? Drop it in the comments below!