Installing and Setting Up OpenCode

Harry · 13 Sep 2026 · 4 views

Prerequisites

You need Node.js installed on your machine. OpenCode is distributed as an npm package and also as a standalone installer for macOS and Linux.

Install with npm

npm install -g opencode

Once installed, open a terminal inside any project folder and start OpenCode with:

opencode

Install on macOS and Linux

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

Authenticate a Model Provider

opencode auth login

Choose your provider, paste an API key from your provider account, and OpenCode is ready to use. You can add several providers and switch at any time.

Key Points

  • Install globally with npm, or use the official installer.
  • Run opencode inside the folder you want it to work in.
  • Add your own API keys with opencode auth login.
  • You pay the provider, not for the tool.
Share this post:

Comments (0)

Please login or register to comment.