opencode/README.zht.md
Aiden Cline 501b15af26
Some checks are pending
check / typecheck (push) Waiting to run
deploy-files / deploy (push) Waiting to run
deploy-www / deploy (push) Waiting to run
deploy / deploy (push) Waiting to run
nix-eval / nix-eval (push) Waiting to run
publish / version (push) Waiting to run
publish / build-cli (push) Blocked by required conditions
publish / sign-cli-macos (push) Blocked by required conditions
publish / build-node-app-archive (push) Blocked by required conditions
publish / build-node-cli (map[bun_install_flags:--cpu=* host:blacksmith-4vcpu-windows-2025 target:windows-arm64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-ubuntu-2404 target:linux-x64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-ubuntu-2404-arm target:linux-arm64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-windows-2025 target:windows-x64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:macos-26 target:darwin-arm64]) (push) Blocked by required conditions
publish / sign-cli-windows (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--cpu=* host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=arm64 host:macos-26 platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=x64 host:macos-26-intel platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404-arm platform_flag:--linux --arm64 target:aarch64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Blocked by required conditions
publish / publish (push) Blocked by required conditions
publish / notify-discord-v2 (push) Blocked by required conditions
test / affected packages (push) Waiting to run
test / unit (linux) (push) Waiting to run
test / unit (windows) (push) Waiting to run
test / build (linux) (push) Waiting to run
test / build (windows) (push) Waiting to run
test / e2e (linux, app-1) (push) Blocked by required conditions
test / e2e (linux, app-2) (push) Blocked by required conditions
test / e2e (linux, app-components) (push) Blocked by required conditions
test / e2e (linux, session-ui-components) (push) Blocked by required conditions
test / e2e (windows, app-1) (push) Blocked by required conditions
test / e2e (windows, app-2) (push) Blocked by required conditions
test / e2e (windows, app-components) (push) Blocked by required conditions
test / e2e (windows, session-ui-components) (push) Blocked by required conditions
test / e2e (linux) (push) Blocked by required conditions
test / e2e (windows) (push) Blocked by required conditions
docs: point README install methods at V2 (#56839)
2026-10-18 12:13:28 -05:00

5.2 KiB
Raw Permalink Blame History

OpenCode logo

開源的 AI Coding Agent。

Discord npm Build status

English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська | বাংলা | Ελληνικά | Tiếng Việt

OpenCode Terminal UI


安裝

# 直接安裝 (YOLO)
curl -fsSL https://opencode.ai/v2/install | bash

# 套件管理員
npm i -g @opencode/cli@latest      # 也可使用 bun/pnpm/yarn
brew install anomalyco/tap/opencode-v2 # macOS 與 Linux(推薦,始終保持最新)
brew install opencode              # macOS 與 Linux(官方 brew formula,更新頻率較低)
sudo pacman -S opencode            # Arch Linux (Stable)
paru -S opencode-beta              # Arch Linux (Latest from AUR)
mise use -g opencode               # 任何作業系統
nix run github:anomalyco/opencode  # Nix

Tip

安裝前請先移除 0.1.x 以前的舊版本。

桌面應用程式 (BETA)

OpenCode 也提供桌面版應用程式。您可以從 opencode.ai/download 下載。

平台 下載連結
macOS (Apple Silicon) opencode-desktop-mac-arm64.dmg
macOS (Intel) opencode-desktop-mac-x64.dmg
Windows opencode-desktop-win-x64.exe
Linux .deb, .rpm, 或 AppImage
# macOS (Homebrew Cask)
brew install --cask opencode-desktop

安裝目錄

安裝腳本會依據以下優先順序決定安裝路徑:

  1. $OPENCODE_INSTALL_DIR - 自定義安裝目錄
  2. $XDG_BIN_DIR - 符合 XDG 基礎目錄規範的路徑
  3. $HOME/bin - 標準使用者執行檔目錄 (若存在或可建立)
  4. $HOME/.opencode/bin - 預設備用路徑
# 範例
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/v2/install | bash
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/v2/install | bash

Agents

OpenCode 內建了兩種 Agent,您可以使用 Tab 鍵快速切換。

  • build - 預設模式,具備完整權限的 Agent,適用於開發工作。
  • plan - 唯讀模式,適用於程式碼分析與探索。
    • 預設禁止修改檔案。
    • 執行 bash 指令前會詢問權限。
    • 非常適合用來探索陌生的程式碼庫或規劃變更。

此外,OpenCode 還包含一個 general 子 Agent,用於處理複雜搜尋與多步驟任務。此 Agent 供系統內部使用,亦可透過在訊息中輸入 @general 來呼叫。

了解更多關於 Agents 的資訊。

線上文件

關於如何設定 OpenCode 的詳細資訊,請參閱我們的 官方文件。

參與貢獻

如果您有興趣參與 OpenCode 的開發,請在提交 Pull Request 前先閱讀我們的 貢獻指南 (Contributing Docs)。

基於 OpenCode 進行開發

如果您正在開發與 OpenCode 相關的專案,並在名稱中使用了 "opencode"(例如 "opencode-dashboard" 或 "opencode-mobile"),請在您的 README 中加入聲明,說明該專案並非由 OpenCode 團隊開發,且與我們沒有任何隸屬關係。


加入我們的社群 飞书 | X.com