Type to search…

Basic

Introduction

Opencode is a free and open-source AI programming assistant.

It provides a local TUI (terminal user interface) that connects to various LLM providers, allowing you to use AI to assist with coding tasks directly from your terminal.

Install

Desktop

Go to https://opencode.ai/download

Terminal

On Windows use Bun to install OpenCode.

shell
bun add -g opencode-ai

On Linux and macOS use curl:

shell
curl -fsSL https://opencode.ai/install | bash

opencode works as a single binary with no dependencies. The install script automatically detects your operating system and architecture and downloads the correct binary.

You don’t need to worry whether you’re on macOS with Apple Silicon, Linux with Intel, or WSL on Windows.

Provider

With OpenCode you can use any LLM provider by configuring their API keys.

OpenCode is an interface that talks to language models. Without configuring this connection, it cannot do anything.

/connect is an OpenCode TUI command used inside the OpenCode terminal interface to add API credentials for LLM providers.

Type /connect in the prompt

shell
/connect

If you haven’t connected to any provider yet, it will show “No provider connected”.

When you run /connect, OpenCode will display a list of supported LLM providers.

OpenCode shows the active provider and model at the bottom of the screen.

Once the provider is configured, verify it works by typing anything:

shell
> Hello!

You're reading a preview.

Sign in to read the full article. Any account opens 10 free articles a month; students and teachers read their course pages without limit.

Sign in