Search⌘ K
AI Features

Introduction to OpenCode

Explore how OpenCode operates as an open-source AI coding agent integrated directly within your project. Understand its unique ability to access your entire codebase, manage context across files, and apply changes automatically. This lesson introduces OpenCode’s core workflow, benefits over chat-based tools, installation, and model connection to help you collaborate efficiently with AI.

Chances are you’re already using AI in your coding workflow. For example, you might use ChatGPT to interpret an error, Claude to refactor a function, or Copilot to autocomplete code as you type. But there’s a common limitation: these tools don’t have direct access to your repo’s full context.

Here’s what that looks like in practice:

  1. You encounter a bug. You copy the error message into ChatGPT, which suggests a fix.

  2. You paste that fix back into your editor, but it fails because the AI lacked awareness of your project structure.

  3. You copy more context, the AI revises its suggestion, and you paste it again.

You’ll usually get to a solution, but you waste a lot of time copying code and context back and forth. That context switching breaks your flow and limits how much the tool can actually help. You cannot ask an AI to ”refactor this entire module” when the character limits of a chat box constrain you. You cannot say ”update all the files that import this function” when the AI cannot see your imports.

OpenCode reduces this overhead by running within your project, enabling it to work directly with your repo. It’s open source and supports free-to-use models.

What is OpenCode?

OpenCode is an open-source AI coding agent that operates directly within your codebase. It runs locally from your terminal, maintains awareness of your entire repository structure, and can read, modify, and reason about your code without requiring you to manually shuttle context back and forth.

Unlike ...