OpenCode
// OpenCode CLI install

OpenCode CLI install in under a minute.

A single signed binary on macOS, Linux, and Windows — no runtime, no dependencies, no container. The OpenCode CLI install flow is one command, one checksum, one signature verification, and you are at a prompt.

Install snapshot

OpenCode CLI install is a static binary drop. On macOS or Linux, pipe the signed installer through sh. On Windows, run winget install OpenCode.OpenCode or the MSI. Every artifact is signed with a pinned key, published in a transparency log, and shipped with a CycloneDX SBOM.

Install method matrix
OSCommandSignatureUpdate channel
macOS (Intel / Apple silicon)curl -fsSL https://opencode.gr.com/install.sh | shSigstore cosignHomebrew, self-update
Linux x86_64 (glibc)curl -fsSL https://opencode.gr.com/install.sh | shSigstore cosignapt, yum, self-update
Linux aarch64ARCH=arm64 curl -fsSL https://opencode.gr.com/install.sh | shSigstore cosignapt, yum, self-update
Alpine / muslapk add --no-cache opencode-staticSigstore cosignapk repository
Windows x64 / ARM64winget install OpenCode.OpenCodeAuthenticode + cosignwinget, MSI auto-update
Offline / air-gappedtar xzf opencode-offline.tgz && ./install.sh --offlineSigstore cosign detachedmanual pin

One-line OpenCode CLI install on macOS and Linux.

The fastest OpenCode CLI install path is a single shell command. It fetches the signed installer, verifies the binary against a pinned public key, and places opencode on your PATH.

curl -fsSL https://opencode.gr.com/install.sh | sh
# or, inspect before running:
curl -fsSL https://opencode.gr.com/install.sh -o install.sh
shasum -a 256 install.sh
less install.sh
sh install.sh

The installer defaults to /usr/local/bin, but you can override with INSTALL_DIR=$HOME/.local/bin for user-scoped installs that do not require sudo. If a previous OpenCode CLI install exists on PATH, the script prompts before overwriting. The install takes less than ten seconds on a typical broadband connection.

Signature verification on download.

Each release publishes a detached Sigstore signature, a SHA-256 checksum, and the build attestation. The installer verifies the signature automatically, but you can reproduce the check by hand.

cosign verify-blob \
  --certificate-identity "release@opencode.gr.com" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  --signature opencode.sig \
  --bundle opencode.bundle \
  opencode

The pinned identity is published in the changelog for every release and rotated on an advertised schedule. If verification fails, do not install — that binary is not ours. Report the failure on the developer support page so the release team can investigate and publish an advisory.

OpenCode CLI install on Windows.

Windows has three sanctioned OpenCode CLI install paths: winget, the signed MSI, and a portable zip. Endpoint management teams can pick whichever fits the deployment tool they already run.

The winget manifest is maintained by the OpenCode release team and updated the same day as every stable release. The MSI is signed with Authenticode, registers an uninstaller entry, installs PowerShell completions, and adds opencode.exe to the system PATH. The portable zip is for workstations where an MSI is not permitted; unzip it into a folder that is already on PATH and you are done.

winget install and MSI.

A one-line PowerShell install covers most laptops. The MSI is the right choice when Group Policy or an endpoint management tool expects an MSI package.

# winget (recommended)
winget install OpenCode.OpenCode

# MSI (Group Policy, SCCM, Intune)
msiexec /i OpenCode-v2026.4.0-x64.msi /qn

# Verify
opencode --version
opencode doctor

After the MSI completes, opencode --version should print the pinned release and opencode doctor reports the platform, the configured provider, and the sandbox posture. The PowerShell completion script lands in the current user module path and is picked up on the next shell.

Offline and air-gapped OpenCode CLI install.

When policy forbids reaching the public internet, the OpenCode CLI install still works with an offline bundle: a tar archive containing the binary, the signature, the checksum, and the reference config.

Download the bundle on a connected machine, verify the signature, and copy it across your approved transfer channel. On the target host, extract the archive and run ./install.sh --offline. The script skips the network verification step, trusts the pre-verified signature stored alongside the binary, and reports the provenance data for the audit log. The offline bundle is the same one endpoint management teams pin in internal mirrors.

Shell completions and doctor.

Shell completions are generated by the CLI itself, not baked into the installer. That keeps the OpenCode CLI install minimal and the completions fresh for whichever shell you run.

opencode completion bash   > /etc/bash_completion.d/opencode
opencode completion zsh    > "${fpath[1]}/_opencode"
opencode completion fish   > ~/.config/fish/completions/opencode.fish
opencode completion powershell | Out-String | Invoke-Expression

The opencode doctor command reports platform, binary signature, active config, provider endpoint, and sandbox permissions. Running it once after OpenCode CLI install is the fastest way to prove the environment is healthy before the first prompt.

Team-wide OpenCode CLI install rollouts.

A team rollout of the OpenCode CLI install follows the pattern you would use for any other static binary tool: pin a version, mirror the artifact, and distribute a shared config.

Most platform teams pin to the current LTS, mirror the signed artifact into an internal object store, and push it with the same tool they use for other developer binaries. A shared config.toml points at the team gateway, pins the model name, and sets the sandbox policy. New hires get the CLI on day one, they pick it up through endpoint management, and the opencode doctor output lands in the onboarding check script. The documentation covers the full config surface, and the custom API guide covers the gateway side.

Uninstall cleanly.

Removing the OpenCode CLI is a single command on every OS. The installer leaves no daemons and no background services behind.

On macOS or Linux, run opencode uninstall or delete /usr/local/bin/opencode. On Windows, the MSI registers an uninstaller entry visible in Apps & Features; winget users can run winget uninstall OpenCode.OpenCode. Config files in ~/.config/opencode are preserved by default so a future reinstall picks up the same provider — add --purge to remove config and cached artifacts as well.

Run the first prompt now.

Paste the one-line OpenCode CLI install, verify the signature, and run opencode doctor. You will be at a working prompt before your coffee cools.

Install-day stories

Real teams that shipped the CLI in one afternoon.

I ran the curl installer, read --help, and had the first diff applied inside five minutes. That is as low-friction as a coding agent gets on a fresh laptop.

— Harpreet K. Gill-Mahabir, Staff Engineer, Halcyondale

The offline bundle is why we could deploy the OpenCode CLI install on our air-gapped build fleet. We verified the signature once on the staging host and mirrored it internally.

— Nikolaj P. Ravndalsvik, DevRel Engineer, Stoattide Labs
CLI install FAQ

Questions engineers ask before the first OpenCode CLI install.

Answers aimed at developers running the OpenCode CLI install on a workstation, a CI runner, or a mirrored internal endpoint. Follow the links for platform-specific detail.

How do I install the OpenCode CLI on macOS or Linux?
Run curl -fsSL https://opencode.gr.com/install.sh | sh. The installer fetches the signed binary, verifies the signature against a pinned Sigstore identity, and drops opencode into /usr/local/bin. Override the target directory with INSTALL_DIR.
How do I install the OpenCode CLI on Windows?
Use winget install OpenCode.OpenCode or the signed MSI from the download page. Both register the CLI on PATH and install PowerShell completions. See the OpenCode Windows page for Group Policy deployment details.
Can I verify the OpenCode CLI signature manually?
Yes. Each release publishes a detached Sigstore signature, a SHA-256 checksum, and a build attestation. Use cosign verify-blob with the release identity printed in the changelog to confirm a binary before you put it on PATH.
Does the OpenCode CLI install support offline workstations?
Yes. The offline bundle is a tar archive with the binary, the detached signature, the SHA-256 checksum, and the reference config. Verify it on a connected host, transfer it across your approved channel, and run ./install.sh --offline on the target.
How do I roll the CLI out to a team?
Pin a release, mirror the signed artifact into an internal object store, and push it with your usual endpoint management tool. A shared config.toml points every workstation at the team gateway. See custom API for gateway posture.