What you need before installing

OpenCode runs on Windows, Mac, and Linux. You’ll need:

  • A computer with one of those operating systems
  • A terminal or command prompt app
  • An internet connection

The installer handles everything else. No need to manually download files or set up dependencies.

Install on Mac or Linux

Open the Terminal app and paste this command:

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

This downloads the official installer and runs it. The installer puts the OpenCode binary in your home directory under .opencode/bin/. It also adds the directory to your PATH automatically.

If the install succeeds, you’ll see a message confirming the installation. Restart your terminal to make sure the new PATH takes effect.

Install on Windows

Open PowerShell as Administrator and run:

irm https://opencode.ai/install.ps1 | iex

The Windows installer works the same way as the Mac/Linux version. It downloads the binary and adds it to your PATH.

If you get a security warning about running scripts, you may need to adjust your execution policy. Run this first, then try the install command again:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Verify the install

After installing on any platform, run this in your terminal:

opencode --version

You should see the version number printed. If you get a “command not found” error, the PATH didn’t update. Restart your terminal and try again.

First run

To start OpenCode in your current project, run:

cd your-project-folder
opencode

OpenCode will ask you to log in or connect an API key on first run. You can:

  • Sign up for a free Zen account
  • Subscribe to Go for $10/month
  • Use your own API key from OpenAI, Claude, or another provider

The first option is the fastest way to try OpenCode without spending money.

Next steps

Once OpenCode is running, you can:

  • Ask it to read your codebase and explain functions
  • Generate code based on your requirements
  • Debug issues by describing the problem
  • Refactor existing code

OpenCode works in your terminal by default. You can also use it as a desktop app or IDE extension. Check the official docs for more details.


This post is part of the @aicoding_id series on AI coding tools. Follow us on TikTok for more reviews and tutorials.