Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

如何在不同操作系统上安装OpenCode?

2025-08-25 49

OpenCode提供了多种安装方式以适应不同操作系统环境和用户习惯:

快速安装(推荐)

使用官方一键安装脚本适用于大多数macOS和Linux用户:
curl -fsSL https://opencode.ai/install | bash

Package Manager Installation

  • npm用户:npm i -g opencode-ai@latest
  • Homebrew用户:
    brew install sst/tap/opencode
  • Arch Linux users:
    paru -S opencode-bin

自定义安装

通过设置环境变量指定安装目录:
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash

安装前请确保移除所有低于0.1.x版本的旧安装,以避免冲突。

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish