### Install GitHub Agent for OpenCode Source: https://github.com/vbgate/learn-opencode/blob/main/docs/4-scenarios/coder-cicd.md Run this command in your GitHub repository root to start the installation wizard. It guides you through setting up the GitHub App, generating workflow files, and configuring necessary secrets. ```bash opencode github install ``` -------------------------------- ### Install and Start OpenCode Source: https://context7.com/vbgate/learn-opencode/llms.txt Commands for installing OpenCode on various operating systems and launching the TUI interface with different configurations. ```bash # macOS / Linux 一键安装 curl -fsSL https://opencode.ai/install | bash # Windows 使用 Scoop 安装 scoop install opencode # 验证安装成功 opencode --version # 输出: opencode x.x.x # 启动 OpenCode TUI 交互界面 opencode # 带初始提示语启动 opencode --prompt "帮我分析这个项目的代码结构" # 使用特定模型启动 opencode -m anthropic/claude-sonnet-4-20250514 # 继续上次会话 opencode -c ``` -------------------------------- ### OpenCode Installation Output Source: https://github.com/vbgate/learn-opencode/blob/main/docs/1-start/02-install.md This is an example of the expected output when OpenCode is successfully installed on a macOS system. ```bash Installing OpenCode... → Detected: macOS arm64 → Downloading opencode-darwin-arm64... ████████████████████████████████████████ 100% → Installing to ~/.opencode/bin/opencode... → Updating shell configuration... ✓ Installation complete! To get started, restart your terminal and run: opencode ``` -------------------------------- ### Install OpenCode GitHub Integration Source: https://github.com/vbgate/learn-opencode/blob/main/docs/5-advanced/14-github.md Run this command in your GitHub repository's project directory to install the OpenCode GitHub integration. This will guide you through installing the GitHub App, selecting a provider and model, creating a workflow file, and setting up secrets. ```APIDOC ## Install OpenCode GitHub Integration Run the following command in your GitHub repository's project directory: ```bash opencode github install ``` This command initiates an interactive setup process that includes: 1. Installing the OpenCode GitHub App. 2. Selecting your preferred AI provider and model. 3. Creating a workflow file (e.g., `.github/workflows/opencode.yml`). 4. Guiding you through setting up necessary secrets (like API keys). ``` -------------------------------- ### Example Batch Tool Call Source: https://github.com/vbgate/learn-opencode/blob/main/docs/5-advanced/17-tools.md An example demonstrating how to structure a batch call with 'read', 'grep', and 'bash' tools, including their parameters. ```json [ {"tool": "read", "parameters": {"filePath": "src/index.ts", "limit": 350}}, {"tool": "grep", "parameters": {"pattern": "Session\.updatePart", "include": "src/**/*.ts"}}, {"tool": "bash", "parameters": {"command": "git status", "description": "Shows working tree status"}} ] ``` -------------------------------- ### Full Experimental Configuration Example (Bash) Source: https://github.com/vbgate/learn-opencode/blob/main/docs/appendix/experimental-features.md A comprehensive example of experimental feature configuration. Add this to your shell profile and source it. It includes enabling web search, LSP tools, and UI features. ```bash # ═══════════════════════════════════════════════════════════════ # OpenCode 实验性功能配置 # 添加到 ~/.zshrc 或 ~/.bashrc,然后 source 一下 # ═══════════════════════════════════════════════════════════════ # 一键启用所有实验性功能(下面这些单独开关会自动被包含) # export OPENCODE_EXPERIMENTAL=true # ─────────────────────────────────────────────────────────────── # 网络搜索(需要 Exa API,或使用 Zen 托管模型自动启用) # ─────────────────────────────────────────────────────────────── export OPENCODE_ENABLE_EXA=true # 启用 websearch 工具 # ─────────────────────────────────────────────────────────────── # LSP(语言服务器协议)增强 # ─────────────────────────────────────────────────────────────── export OPENCODE_EXPERIMENTAL_LSP_TOOL=true # 启用 LSP 工具 export OPENCODE_EXPERIMENTAL_LSP_TY=true # 启用实验性 ty Python 服务器 # ─────────────────────────────────────────────────────────────── # 界面与交互 ``` -------------------------------- ### Custom Command Example Source: https://github.com/vbgate/learn-opencode/blob/main/docs/appendix/prompts.md An example of how to define a custom command for the OpenCode environment. ```markdown