← All articles

Toolsupdated 9 min read

OpenCode guide: why use it, how to install it and how it compares

See how OpenCode compares with Claude Code, Codex, Cursor and DeepSeek Harness. Install Desktop or CLI, choose a model and verify a first edit.

Igor Karmazin · AI Technical Product Operations

OpenCode: first run

OpenCode is an open-source coding agent for working in a project folder. It can read files, propose edits and run commands according to its permissions. Start with Desktop if you want to review changes beside the chat, or use the CLI if you already work from a terminal.

This walkthrough follows the current V2 documentation. If you have an earlier installation, check the version and follow the migration guide before moving your configuration. OpenCode documentation · V1 migration.

Why use OpenCode?

Suppose a website form stops sending enquiries. The code came from another developer and a screenshot gives you no clue where the failure is. Open OpenCode in the project folder and ask it to trace the form from the button to the handler. It can read the relevant files, identify the likely cause, propose an edit and run an available check. Review the Git diff yourself. Then submit a test enquiry from the published page and verify delivery.

OpenCode is useful when you want to change models or providers without changing clients. Try a fast model for finding files and making small edits. If a problem spans several parts of the project, run the same task on the same starting commit with a different model. Keep the acceptance checks fixed. Provider and model availability depends on the current project configuration. Provider documentation.

Task Give the agent Verify
Understand an unfamiliar project A page or function and a request to trace it to the related files Check the paths and read the handler
Fix a mobile layout The route, viewport width and element that overflows Open the page at 360 and 390 pixels and inspect the menu and form
Diagnose a workflow failure A sanitized log and the expected output Reproduce the problem with test data and check a retry
Add a small feature Inputs, expected outputs and the files it may change Check normal, empty and boundary inputs

Use a test copy when starting out. Keep credentials out of that copy and review commands before approving them. A cloud model may receive relevant project content as part of its request. Review provider terms and tool settings before opening sensitive files. OpenCode permissions.

OpenCode vs Claude Code, Codex, Cursor and DeepSeek Harness

Tool When to choose it What to check
OpenCode You want one terminal or desktop client with several models and providers Billing follows the connection. V1 and V2 use different configuration. OpenCode
Claude Code You already use Claude and want its coding workflow in a terminal, editor or desktop app Sign-in options depend on the interface. Some interfaces support third-party providers. Claude Code
Codex You use ChatGPT and want parallel coding tasks or cloud runs Cloud access and limits depend on your plan and workspace. Codex
Cursor You want an editor, agent and review tools in the same place Factor in moving your editor setup if you already have a preferred environment. Cursor
DeepSeek Harness You want to customize the agent environment through plugins Check the status and compatibility of the plugin you need. DeepSeek Harness

If you already have Claude and its workflow suits you, try it on your project before adding another tool. OpenCode is worth evaluating when you want a different model catalog, a local model or more control over provider charges. If you edit code by hand throughout the day, an integrated editor such as Cursor may be a better fit. OpenCode Desktop or the CLI can sit beside an editor you already use.

This is a workflow comparison. For a quality comparison, start every tool from the same commit, give it the same task, and run the same tests. Track manual fixes, time and usage charges. Record which client and model you used so the result is reproducible.

Free models, OpenCode Go and API billing

The client is open source. Check for a free catalog option for a short trial. If you bring your own key, your provider tracks and charges for use. On November 16, 2026, OpenCode listed Go at $10 per month and Go Plus at $40 per month. Allowances vary by model and plan. Check the included models and limits before subscribing. OpenCode Go pricing.

OpenCode also documents a ChatGPT sign-in route for Plus and Pro that uses the plan allowance for the supported connection. To try local inference, run a model in Ollama and follow the OpenCode provider guide. Verify speed and tool use on a small edit before choosing it for a larger project. ChatGPT and Ollama connections · Ollama guide.

Download OpenCode Desktop

Choose the installer on the official download page. On a Mac with an M-series chip, pick Apple Silicon. For an Intel Mac, pick Intel. Windows builds are available for x64 and ARM64. On Linux, match the package to your distribution. Open a small project folder with changes you can safely inspect and undo. Official downloads.

Install the OpenCode CLI

On a Mac with Homebrew:

brew install anomalyco/tap/opencode-v2
opencode --version

On macOS or Linux with npm already installed, you can use the V2 npm package:

npm install -g @opencode/cli
opencode --version

Choose one route. On Windows, use the standalone CLI binary provided in the documentation or start with Desktop. If you still see an old version, check the executable with command -v opencode on Mac or Linux, or Get-Command opencode in PowerShell. CLI installation.

Then start the terminal agent from your project folder:

cd path/to/project
opencode

Connect a provider and choose a model

In the terminal interface, run /connect to connect a provider. Then open /models and pick a model available to the current project. In Desktop, use the corresponding provider and model controls.

Route Use it for Check first
Free model from the catalog A short trial Availability, limits and data handling
Your own provider key Selecting a model and tracking expenses in your provider account Pricing, balance and model availability
OpenCode Go A curated catalog through a subscription Included models and current allowances
Local model with Ollama Running inference on your computer Memory, speed and tool use

Try a fast model on a small edit. If it struggles, run the same task with another one and compare the resulting diff and tests. For a local model, a chat response is only the first check. Give it a small file edit to see whether it handles tools. Enter keys in the provider connection interface and keep them out of commits. Providers · Model catalog · Ollama installation.

Make a first edit you can verify

In a test folder, save this as names.py:

def normalize_name(value):
    return value.strip().title()

Save the following as check_names.py. Its second assertion fails on the starting function:

from names import normalize_name
assert normalize_name("  ada lovelace  ") == "Ada Lovelace"
assert normalize_name("ada   lovelace") == "Ada Lovelace"
assert normalize_name("  ") == ""
print("OK")

Run python3 check_names.py on macOS or Linux, or py check_names.py on Windows with the Python Launcher installed. Save the starting point to a local Git commit:

git init
git add names.py check_names.py
git commit -m "Add demo files"

Open the folder in Desktop or start opencode there. Ask it to explain the failure, then give it one concrete task:

Change only names.py. Collapse consecutive spaces between words to one space and preserve the empty-string behavior. Keep check_names.py untouched. Show the diff and suggest the verification command.

Run git diff -- names.py check_names.py and repeat the check yourself. With a correct edit it prints OK. Restore the original check file if the agent edited it. Inspect commands before approving them. OpenCode V2 uses the permissions setting for command rules. Permission reference.

Troubleshooting the first run

  • A model is missing. Check the provider connection and model availability for the current project.
  • Authentication or quota error. Verify which provider is selected and check that provider's key, balance or subscription limits.
  • The project looks empty. Confirm the current folder and that your files were saved.
  • The agent made extra edits. Inspect git status --short and the diff. Keep changes small enough to verify.

FAQ

Is OpenCode free?

OpenCode is open source. Model costs depend on the connection you use. Some catalog options can be free, and API or subscription usage follows the provider's terms.

Can I use DeepSeek with OpenCode?

Connect a provider that offers the model and check the model selector. Supported versions, prices and allowances depend on the provider.

Should I start with Desktop or CLI on Mac?

Desktop gives you a visual diff and chat. The CLI is convenient if you already keep a terminal open in your Git project.

The Python exercise was checked independently. Provider setup is based on the official documentation.

DeepSeek Harness · Vibe coding · Build a website with AI

Read on Telegram