GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing www.runoob.com — OpenCode GitHub | 菜鸟教程
OpenCode 教程
OpenCode 教程
OpenCode 简介
OpenCode 安装
OpenCode API 设置
OpenCode DeepSeek
OpenCode 配置文件
OpenCode 第一次使用
OpenCode VSCode
OpenCode TUI
OpenCode CLI 使用
OpenCode Web 使用
OpenCode GitHub
OpenCode GitLab
OpenCode 工具
OpenCode 规则
OpenCode 代理
OpenCode 主题
OpenCode 快捷键
OpenCode 自定义命令
OpenCode 格式化工具
OpenCode 权限配置
OpenCode LSP 服务器配置
OpenCode MCP 服务器配置
OpenCode Skills
OpenCode skills 使用
OpenCode 自定义工具
OpenCode oh-my-openagent
OpenCode 生态系统
OpenCode 配置文件
OpenCode GitHubOpenCode 可以深度集成 GitHub 工作流,让 AI 直接参与 Issue、Pull Request 和代码审查流程。 通过在评论中输入 /opencode 或 /oc,即可触发 AI 自动执行任务。 OpenCode GitHub = 把 AI 变成你的自动化开发成员,直接参与 Issue、PR 和代码流程。 一、核心能力
特点:
二、快速安装(推荐)在 GitHub 项目根目录运行: opencode github install 该命令会自动完成:
三、手动安装(进阶)1、安装 GitHub App访问: https://github.com/apps/opencode-agent 安装到你的仓库 2、添加工作流文件创建文件: .github/workflows/opencode.yml 示例: name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
3、配置 Secrets在 GitHub 仓库中:
四、配置参数说明
说明:
五、支持的触发事件
六、常见使用方式1、解释 Issue在 Issue 评论: /opencode explain this issue AI 会总结问题并解释 2、自动修复 Issue/opencode fix this 自动:
3、修改 PRDelete the attachment from S3 when the note is removed /oc 直接在 PR 上执行修改 4、代码行级操作(非常强)在 PR 的 Files 页面评论: /oc add error handling here OpenCode 会自动获取:
无需手动说明位置 七、定时任务(自动化)示例:每周扫描 TODO on:
schedule:
- cron: "0 9 * * 1"
示例 prompt: Review the codebase for TODO comments and summarize them 注意:
八、PR 自动审查示例: on:
pull_request:
types: [opened, synchronize]
默认行为:
九、Issue 自动分类可以自动处理新 Issue,例如:
注意:
十、自定义提示词(高级用法)可以覆盖默认行为: prompt: | Review this pull request: - Check for bugs - Suggest improvements 用于:
十一、安全与权限推荐权限配置: permissions: id-token: write contents: write pull-requests: write issues: write 说明:
AI 思考中...
点我分享笔记取消
分类导航
Advertisement
| ||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |