PAS7 Studio
Abstract editorial illustration for a guide to OpenCode AI coding agent
Technology28 Jul 2026·9 min read·Updated 28 Jul 2026

How to Use OpenCode in 2026: Features, Pricing, Setup, and Best Practices

Learn how to use OpenCode, the open-source AI coding agent for terminal, desktop, and IDE workflows. This guide covers setup, models, OpenCode Zen pricing, agents, permissions, commands, MCP, advantages, and practical prompts.

Software developersFounders building productsTechnical leadsStudents learning to code

OpenCode is an open-source AI coding agent that works in a terminal-based interface, desktop app, or IDE extension. To use it, install OpenCode, open a project directory, connect an LLM provider, run /init, and give the agent a specific task. Start in Plan mode for larger changes, then switch to Build mode and review the diff and tests before committing.

Install with the official script or npm, then run `opencode` inside a project.
Connect OpenCode Zen or bring an API key from a supported provider.
Run `/init` so OpenCode can understand the repository and create AGENTS.md.
Use Plan mode, explicit file references, tests, and permission rules for safer output.
Xin
quick answer

What is OpenCode?

OpenCode is an open-source coding agent designed to work with your repository, terminal, tools, and preferred model provider. It is not a single chatbot subscription: the interface is open source, while model access and usage are configured separately.

Use it from a terminal-based interface, desktop app, or IDE extension.
Choose among many LLM providers instead of being locked to one model company.
Let the agent read files, search the codebase, edit code, run commands, and use configured tools.
Create project rules, custom agents, reusable commands, MCP connections, and permission policies.
Keep a human in the loop: inspect proposed changes, run tests, and commit deliberately.
first session

How to install and start OpenCode

The fastest path is to get one small project working before you customize the entire setup.

01

Install OpenCode

Use curl -fsSL https://opencode.ai/install | bash, or install the npm package globally with npm install -g opencode-ai. On Windows, the official docs recommend WSL for the best compatibility; Chocolatey, Scoop, npm, Docker, and prebuilt releases are also documented.

02

Open your project

Run cd /path/to/project, then launch opencode. Start from a Git branch or a clean working tree so every change is easy to review.

03

Connect a model provider

Run /connect in the TUI. You can choose OpenCode Zen or configure a provider such as Anthropic, OpenAI, Google, or another supported service with your own API key.

04

Initialize the repository

Run /init. OpenCode analyzes the project and creates an AGENTS.md file with repository-specific context. Review it and commit it when it reflects your real conventions.

05

Ask for a bounded first task

Try a small request such as explaining one module, adding a test for one function, or fixing one reproducible bug. Give the relevant file path, expected behavior, constraints, and the command that verifies success.

A reliable first prompt

Inspect @src/auth/session.ts. Explain how refresh tokens work, identify one security risk, and propose a minimal fix. Do not edit files yet; include the test command you would run.

capabilities

OpenCode features that matter in daily development

Plan and Build modes

Plan mode lets the agent inspect the project and propose an implementation without changing files. Switch to Build mode when the approach is clear. This is especially useful for migrations, authentication, and cross-file refactors.

Multiple providers and models

OpenCode separates the coding interface from the model provider. You can compare models for reasoning, speed, cost, or long-context work instead of rebuilding your workflow each time.

Agents and subagents

Built-in and custom agents can specialize in building, planning, exploration, documentation, or code review. Subagents are useful for isolated research and repeatable roles.

Custom commands

Create commands such as /test, /review, or /release-notes in .opencode/commands/. A command can include a reusable prompt, arguments, an agent, and a model.

MCP, LSP, and tools

OpenCode can be extended with MCP servers, language-server features, web access, and project tools. Add only the tools a workflow actually needs and keep their permissions narrow.

Undo, redo, and share

Use /undo and /redo while iterating. /share creates a link to a conversation when you intentionally want to share it; conversations are not shared by default.

costs

OpenCode pricing: what do you actually pay for?

OpenCode itself is open source. Your bill depends on the model provider and the way you connect it. OpenCode Zen is optional and uses pay-as-you-go billing per one million tokens, not a single flat monthly subscription.

RouteHow it worksBest for
Bring your own keyConnect a provider directly and pay that provider's API rate.Teams with existing cloud or model accounts and their own budgets.
OpenCode ZenUse a tested and verified model catalog. Pricing is per 1M input/output tokens and varies by model.People who want a simpler starting point and a curated provider experience.
Free Zen modelsThe Zen page currently lists several free models, marked as available for a limited time.Learning, experiments, and low-risk prototypes; do not assume availability is permanent.

Think of OpenCode as the open-source workbench. The model route is a separate choice: your own API key, OpenCode Zen, or a temporarily free model.

Section pricing screenshot
quality and safety

How to get better results from OpenCode

The strongest OpenCode workflow looks more like a careful engineering process than a one-line prompt.

Give the agent a clear outcome

Describe what should be true when the task is finished, not only the file you want edited.

Reference files with @

Point OpenCode at the relevant implementation, tests, types, and examples instead of making it search an entire monorepo blindly.

Plan risky work first

Use Plan mode for database changes, auth, payments, public APIs, large refactors, and unfamiliar code.

Require verification

Ask OpenCode to run the narrowest relevant test, typecheck, linter, or build and report failures instead of claiming success.

Set permissions intentionally

Use allow, ask, and deny rules for read, edit, bash, task, web access, and external directories. Keep destructive commands behind approval.

Keep AGENTS.md current

Treat project instructions as living documentation: architecture, commands, style, testing expectations, and things the agent must never do.

when to use it

What is OpenCode good for?

Great fit

Understanding unfamiliar code, implementing small-to-medium features, generating tests, debugging reproducible failures, refactoring, writing docs, reviewing diffs, and automating repeatable repository tasks.

Use extra review

Authentication, payments, migrations, security fixes, concurrency, infrastructure, and anything that changes user data. Let OpenCode accelerate the work, but make the final engineering decision yourself.

Poor fit

Vague product direction, unsupervised production changes, secrets pasted into prompts, or tasks where nobody can explain the expected behavior and verification criteria.

FAQ

FAQ

Is OpenCode free?

OpenCode is open source, but model usage may cost money. You can bring your own provider key, use OpenCode Zen pay-as-you-go, or try the free models listed by Zen while they are available.

Does OpenCode work on Windows?

Yes. The official documentation recommends WSL for the best Windows experience. Chocolatey, Scoop, npm, Docker, and prebuilt releases are also listed installation routes.

What is OpenCode Zen?

OpenCode Zen is an optional curated gateway with models tested and verified by the OpenCode team. It charges per request using token-based pricing.

Can OpenCode edit files and run commands?

Yes, when the relevant tools and permissions allow it. Configure permissions so reading, editing, shell commands, subagents, and external directories have the level of approval your project requires.

How do I start an OpenCode project?

Open the project directory, run `opencode`, connect a provider with `/connect`, then run `/init`. After that, give OpenCode a bounded task with file references and a verification command.

references

OpenCode sources and documentation

Reviewed: 28 Jul 2026Applies to: OpenCode TUIApplies to: OpenCode desktopApplies to: OpenCode IDE extensionApplies to: OpenCode ZenTested with: OpenCode official documentationTested with: OpenCode Zen pricing documentationTested with: OpenCode GitHub repository

Is OpenCode worth using?

Describe the task — first 15 minutes of consultation are free.

Related Articles

AI Assistant Development Cost in 2026: RAG Chatbots, CRM Integrations, Guardrails, and Support
ai-assistants

AI Assistant Development Cost in 2026: RAG Chatbots, CRM Integrations, Guardrails, and Support

A practical buyer guide to AI assistant development cost in 2026: prototypes, RAG chatbots, knowledge-base assistants, CRM and website integrations, guardrails, evaluations, monitoring, and support.

AI for landing page development: where it speeds up launches and where it hurts conversion
blogs

AI for landing page development: where it speeds up launches and where it hurts conversion

A practical research piece on using AI for landing page development: v0, Webflow AI, Builder.io, Framer-like builders, UX generation, copy, SEO, personalization, A/B testing, template risk, accessibility, security and technical debt.

AI SEO / GEO in 2026: Your Next Customers Aren’t Humans — They’re Agents
growth

AI SEO / GEO in 2026: Your Next Customers Aren’t Humans — They’re Agents

Search is shifting from clicks to answers. Bots and AI agents crawl, cite, recommend, and increasingly buy. Learn what AI SEO / GEO means, why classic SEO is no longer enough, and how PAS7 Studio helps brands win visibility in the agentic web.

The most powerful Apple chip yet? M5 Pro and M5 Max are breaking records
blogs

The most powerful Apple chip yet? M5 Pro and M5 Max are breaking records

A data-backed March 2026 analysis of Apple M5 Pro and M5 Max. We break down why these chips can credibly be called Apple's most powerful pro laptop silicon, how they compare with M4 Pro, M4 Max, M1 Pro, M1 Max, and how they stack up against Intel and AMD laptop rivals.

Professional development for your business

We create modern web solutions and bots for businesses. Learn how we can help you achieve your goals.