Skip to content
← Blog
7 min read

Vibe Coding with OpenCode: an Open-Source Terminal Agent Guide

What OpenCode is, how it differs from Claude Code, and how to plug in any model — from Claude to DeepSeek — through one OpenAI-compatible key.

guidevibe coding

OpenCode is an open-source coding agent that runs right in your terminal: you describe a task in plain language, and the agent reads your project's code, makes edits, and runs commands. The tool itself is free and open source — you only pay for the tokens of whatever model you connect to it. And OpenCode is not tied to a single vendor: it supports a wide range of LLM providers, including custom OpenAI-compatible endpoints.

If you have been looking for a free, open-source alternative to Claude Code, OpenCode is the most obvious candidate. The idea is the same: the agent lives in the terminal next to your project rather than inside a separate editor. The difference is philosophical: Claude Code is built by Anthropic around the Claude models, while in OpenCode you choose the model and the provider yourself.

In this guide we will cover what OpenCode is and how it works, how it differs from Claude Code, what a vibe-coding workflow looks like in it, and how to connect your own model. For the connection part we will use Kumo as the example: one base URL and one key unlock a full catalog of flagship models, paid for with a Russian bank card.

What OpenCode Is: an Open-Source AI Agent for the Terminal

OpenCode is an open-source project: the source code is public, and the tool can be freely installed, inspected, and used without any subscription. You launch it with the opencode command in your project directory, and it opens a full TUI right in the terminal: conversation history, change review, model switching — all without leaving the console. This is not autocomplete or a chat panel next to an editor; it is an agent you hand a whole task to.

It works in iterations: reading the relevant files, proposing changes, editing code, running tests and commands, checking the result, and continuing. Your role is to set the task, review diffs, and make decisions. That is vibe coding in its terminal form: you steer the direction, the agent does the mechanical work.

The key difference from most alternatives is vendor independence. OpenCode supports dozens of LLM providers — Anthropic, OpenAI, Google, and others — plus any custom service that speaks the OpenAI API. The tool costs nothing by itself; your spending is the tokens of the provider you chose, and nothing else.

The agent picks up project context from an instructions file at the root of the repository — that is where you describe the stack, conventions, and common commands, much like the CLAUDE.md file in Claude Code. Ten minutes spent on that file once will noticeably improve every session afterwards.

Setting Up OpenCode: Installation and First Run

OpenCode installs with a single command — via a package manager such as npm or brew, or with the install script from the official site. After installing, change into your project directory and run opencode: the agent picks up the repository structure and opens its interface.

Next, connect a model provider. OpenCode can authenticate with popular providers through its built-in mechanism: you enter an API key once, it is stored locally, and the list of available models appears in the interface. Custom OpenAI-compatible providers are added through configuration — more on that below.

Before your first serious task, do two things. First, create a project rules file so the agent immediately knows what the code is written in and how to run the tests. Second, decide on boundaries: which commands the agent may run on its own and which you want to confirm manually — OpenCode asks for permission before potentially destructive actions.

OpenCode vs Claude Code: the Differences and Which to Choose

They share more than they differ on: both are terminal agents, both work across a whole project, both plan, edit code, and run commands. If you have learned one, the other will feel familiar within minutes. We covered Claude Code in detail in a separate article in this series — the workflow from there carries over to OpenCode almost entirely.

Claude Code is an Anthropic product designed around the Claude models. That is its strength: the tool and the models evolve together, the agent's behavior is tuned to one model family, and everything works out of the box with no setup. But the frame is the same: you work inside the Anthropic ecosystem and with its models.

OpenCode makes the opposite bet — on openness. The code is open, and you pick the provider and the model: Claude, GPT, DeepSeek, or your own corporate endpoint. You can switch models mid-session to match the task at hand. The price of that freedom is a bit more setup at the start, and the agent's quality depends on the model you chose.

The honest conclusion: this is not a question of better or worse but of priorities. If you want the most polished experience with Claude, take Claude Code. If you want open source, freedom of model choice, and control over your stack, take OpenCode. Nothing stops you from trying both: terminal agents do not conflict with each other.

How to Connect Your Own Model: a Custom OpenAI-Compatible Provider

The most underrated feature of OpenCode is custom providers. Any service that speaks the OpenAI API can be added as a model source: specify a base URL, an API key, and a list of models — and they appear in the model switcher alongside the built-in ones. This is how people connect local models, corporate proxies, and API gateways.

We deliberately avoid quoting exact configuration field names here — they are described in the official OpenCode documentation, and a ready-made config for Kumo lives in the Integrations section of the dashboard and in /docs. Either way, the essence is simple: one JSON block with an address and a key.

Why does this matter in practice? A single OpenAI-compatible endpoint like Kumo gives you the whole catalog at once: Claude Opus 5 and Claude Sonnet 5, GPT-5.6, Gemini 3 Flash, DeepSeek V4 Pro, and more. Instead of three accounts at three labs, you have one key and one balance, and you switch models per task right in the agent's interface.

A Vibe-Coding Workflow in OpenCode

Start with a plan, not with edits. Ask the agent to study the code and propose a plan of changes, read it, and correct it — that is cheaper than rolling back a failed implementation. A well-formulated task with context on what, where, and why saves more tokens than any optimization.

Work in small iterations. One task, one session: the agent makes edits, you review the diff, run the tests, commit. Frequent commits are your insurance: if the agent goes off course, you lose ten minutes, not a day. Do not hesitate to interrupt and rephrase — that is a normal part of the process.

The main economic lever in OpenCode is switching models per task. Send the routine work — renames, boilerplate, simple tests, draft commit messages — to inexpensive models like Gemini 3 Flash or DeepSeek V4 Pro. Send complex refactoring, architectural decisions, and tangled bugs to flagships like Claude Opus 5 or GPT-5.6. That discipline noticeably lowers your average bill without losing quality where it is critical.

And watch your context: keep the project rules file up to date, and start a clean session for each new task. Long, cluttered conversations degrade any model's answers and burn tokens for nothing.

Who OpenCode Is For

OpenCode is for people who live in the terminal and want an open tool without subscriptions or vendor lock-in. If it matters to you to see the tool's source code, pick a model per task, and pay only for tokens, this is your option. It also fits teams that need one agent on top of different providers, including their own endpoints.

It is especially good for experimenters: comparing models on real tasks is easier in OpenCode than almost anywhere — switch the model and repeat the same request. For beginners the entry barrier is slightly higher than with turnkey solutions, but manageable: install, key, first run — an evening's work.

Who it fits less: those who want a fully packaged experience with zero setup, and those who prefer working in a graphical editor rather than a console. In that case, look at Claude Code or the IDE agents — we compared them in our vibe-coding tools overview in this series.

Where Kumo Helps Here

Kumo is an OpenAI-compatible API gateway — exactly the kind of provider OpenCode's custom connection is designed for. One base URL, https://api.kumorouter.com/v1, one key, one prepaid balance — and the model switcher fills with the full catalog: Claude Opus 5, Claude Sonnet 5, Claude Haiku 4.5, GPT-5.6, Gemini 3 Flash, Grok 4.5, DeepSeek V4 Pro, and dozens more. The idea of a cheap model for routine and a flagship for hard problems stops requiring three accounts and three balances.

The economics are honest: you pay only for the tokens you actually use, with no subscriptions, seats, or minimum payments. The effective rate is 30–50% below the labs' official price lists — the exact savings depend on your workload profile and volume, and each model's exact price is visible before you spend a single token. The balance can be topped up with a Russian bank card or via SBP (Faster Payments System), no VPN or foreign card needed.

Control is covered too: every API key can have spending limits and alerts, and you can issue a separate key per project or client. The model is never silently swapped: request Claude Sonnet 5 and you get exactly that, and every response reports which model served it. Kumo does not log prompt bodies — only billing metadata.

A ready-made OpenCode config with the exact field names lives in the Integrations section of the Kumo dashboard, with details in /docs. Sign up at /signup, get a key right away — and start vibe coding.

Start building on Kumo today

One base URL, one balance, every model — at an effective rate you can see before you spend a token