# Install opencode with Homebrew, chocolatey, MacPorts, Nix, pacman, scoop, winget

AI coding agent, built for the terminal. Version 1.18.10 via Homebrew; verified 2026-08-01. Also installable with nix: nix profile install nixpkgs#opencode.

## Install

```sh
sudo av install brew:opencode
```

## Agent safety answer

opencode is an agent-facing coding tool that can read files and invoke local developer workflows.

- **Credential access:** May access repository files, tool configs, and environment variables available to the agent session.
- **Remote mutation:** Can trigger local tools that mutate Git, cloud, or package state.
- **Publish/artifact risk:** Can generate code or commands that become release artifacts.
- **Recommended control:** Run under containment and gate sensitive tool actions.
- **Agent-use guidance:** Use with scanned worktrees; require approval before commands that expose credentials or mutate remote systems.

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install opencode
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install opencode
```

  Evidence: MacPorts ports tree: llm/opencode/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#opencode
```

  Evidence: nixpkgs package indexes: pkgs/by-name/op/opencode/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S opencode
```

  Evidence: Arch Linux sync databases: opencode from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Chocolatey (92%):

```sh
choco install opencode
```

  Evidence: Chocolatey community package catalog: opencode from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','nvs'

- Scoop (92%):

```sh
scoop install main/opencode
```

  Evidence: Scoop official bucket manifest trees: bucket/opencode.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id SST.OpenCodeDesktop -e
```

  Evidence: Windows Package Manager source index: SST.OpenCodeDesktop from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:opencode
- **Package manager:** Homebrew
- **Version:** 1.18.10
- **Source summary:** AI coding agent, built for the terminal
- **Homepage:** <https://opencode.ai>
- **Last updated:** 2026-08-01T03:38:36Z
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- opencode (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 1.18.10
## Project history and usage

OpenCode is an open-source AI coding agent distributed for terminal, IDE, and desktop workflows. The project positions the CLI as a coding assistant with a native terminal interface, LSP awareness, multi-session work, session sharing, and support for many model providers.

### Project history

The official documentation and repository present OpenCode as a rapidly distributed developer tool rather than a project with a deeply documented pre-release history. Its packaging moved across the JavaScript ecosystem, Homebrew, Arch, Windows package managers, Nix, and a beta desktop app, which reflects the AI-coding-agent pattern of shipping a local CLI plus integrations rather than only a hosted service.

The repository installation notes distinguish the project-maintained Homebrew tap from the Homebrew core formula, saying the tap is recommended for faster updates while `brew install opencode` is maintained by Homebrew and updated less frequently. That distinction matters because the package in this batch is the Homebrew formula rather than the upstream tap.

### Adoption history

OpenCode's own site makes large adoption claims, including GitHub stars, contributors, commits, and monthly developer usage. Those are project-published metrics rather than independent measurements, but they show how the project presents itself: as a mainstream open-source alternative in the coding-agent ecosystem.

### How it is used

Developers use `opencode` as an interactive agent for repository work: asking questions, requesting features, making code changes, undoing changes, and running parallel sessions. The docs list API keys as a prerequisite and describe use from a modern terminal emulator, with desktop and IDE forms for users who do not want only a TUI.

### Why package nerds care

OpenCode is package-nerdy because it is a CLI front end over a fast-moving agent stack: releases must coordinate model-provider auth, terminal UI behavior, editor integration, desktop artifacts, and package managers that update at different speeds. Its Homebrew formula is part of a broader install matrix rather than the single canonical upstream channel.

### Sources

- <https://formulae.brew.sh/formula/opencode>
- <https://github.com/anomalyco/opencode>
- <https://opencode.ai/>
- <https://opencode.ai/docs/>


## Security Notes

No matching local secret-handling manifest was found for opencode. Nucleus package metadata is still published here so future coverage has a stable package URL.



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Credential files

- macOS: ~/Library/Application Support/opencode/auth.json, ~/Library/Application Support/opencode/account.json
- Unix: $XDG_DATA_HOME/opencode/auth.json, $XDG_DATA_HOME/opencode/account.json, ~/.local/share/opencode/auth.json, ~/.local/share/opencode/account.json
## Other Package-Manager Records

- Nix - opencode: normalized package name match | nixpkgs package indexes: pkgs/by-name/op/opencode/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - opencode - 1.18.11-1: normalized package name match | Arch Linux sync databases: opencode from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | The open source coding agent | https://github.com/anomalyco/opencode
- MacPorts - opencode: normalized package name match | MacPorts ports tree: llm/opencode/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - opencode: normalized package name match | Chocolatey community package catalog: opencode from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','nvs'
- Scoop - main/opencode: normalized package name match | Scoop official bucket manifest trees: bucket/opencode.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - SST.OpenCodeDesktop: normalized package name match | Windows Package Manager source index: SST.OpenCodeDesktop from https://cdn.winget.microsoft.com/cache/source.msix
- winget - SST.opencode: normalized package name match | Windows Package Manager source index: SST.opencode from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/opencode.yml](https://github.com/mxcl/pkgdb/blob/main/combined/opencode.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
