OpenCode 个人习惯设置大全

前提条件:opencode 已经成功安装了

自动安装 OMO Slim:

Install and configure oh-my-opencode-slim: https://raw.githubusercontent.com/alvinunreal/oh-my-opencode-slim/refs/heads/master/README.md

如果你已经安装了 bun,可以手动安装 OMO Slim:

bunx oh-my-opencode-slim@latest install

然后可选安装:cc-switch(如果你有多平台和多模型配置需求的话,强烈推荐)

opencode.json 文件:远程版

  1. context7(时效性强,编程时更快获取技术框架的最新文档以更新大模型的知识库)

  2. mem0(记忆的持久化)

// 第一个忘了做什么来着了    
"plugin": [".opencode/plugins/graphify.js", "oh-my-opencode-slim@latest"],
    "$schema": "https://opencode.ai/config.json",
    "mcp": {
        "context7": {
            "enabled": true,
            "headers": {
                "CONTEXT7_API_KEY": "???"
            },
            "type": "remote",
            "url": "https://mcp.context7.com/mcp"
        },
        "mem0": {
            "enabled": true,
            "headers": {
                "Authorization": "Token ???"
            },
            "oauth": false,
            "type": "remote",
            "url": "https://mcp.mem0.ai/mcp/"
        }
    },
    "plugin": [".opencode/plugins/graphify.js", "oh-my-opencode-slim@latest"],

opencode.jsonc 文件:本地版

{
    "$schema": "https://opencode.ai/config.json",
    "permission": {
        "task": "allow",
    },
    "instructions": [
        "node_modules/@morphllm/opencode-morph-plugin/instructions/morph-tools.md",
    ],
    "plugin": [
        "@morphllm/opencode-morph-plugin@latest", // 快速修改大型文件
        // "@tarquinen/opencode-dcp@latest", // 动态剪切上下文 替代品 magic context
        "@cortexkit/opencode-magic-context@latest", // 替代 dcp
        "@mohak34/opencode-notifier@latest", // 桌面提醒
        "@nick-vi/opencode-type-inject@latest", // 类型检查
        "@tmegit/opencode-worktree-session@latest", // 项目管理
        "@mem0/opencode-plugin@latest", // 记忆持久化
        "oh-my-opencode-slim@latest", // 多 agent 模型能力强 + 上下文大的模型才有开的必要
        "opencode-pty", // 提升终端交互体验
        "opencode-skills",
        "superpowers@git+https://github.com/obra/superpowers.git", // 著名的 superpowers 技能集
    ],
    "command": {
        "superpower:brainstorming": {
            "description": "Explore user intent, requirements, and design before creative work",
            "template": "Load the `brainstorming` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:dispatching-parallel-agents": {
            "description": "Execute 2+ independent tasks in parallel using subagents",
            "template": "Load the `dispatching-parallel-agents` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:executing-plans": {
            "description": "Execute an implementation plan in a separate session with review checkpoints",
            "template": "Load the `executing-plans` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:finishing-a-development-branch": {
            "description": "Guide completion of development work - merge, PR, or cleanup",
            "template": "Load the `finishing-a-development-branch` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:receiving-code-review": {
            "description": "Process code review feedback with technical rigor before implementing suggestions",
            "template": "Load the `receiving-code-review` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:requesting-code-review": {
            "description": "Verify work meets requirements before committing or merging",
            "template": "Load the `requesting-code-review` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:subagent-driven-development": {
            "description": "Execute independent implementation tasks using subagents in the current session",
            "template": "Load the `subagent-driven-development` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:systematic-debugging": {
            "description": "Debug bugs, test failures, and unexpected behavior systematically",
            "template": "Load the `systematic-debugging` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:test-driven-development": {
            "description": "Write tests before implementation code (TDD workflow)",
            "template": "Load the `test-driven-development` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:using-git-worktrees": {
            "description": "Create isolated workspaces for feature work via git worktrees",
            "template": "Load the `using-git-worktrees` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:verification-before-completion": {
            "description": "Verify work (lint, tests, build) before claiming completion",
            "template": "Load the `verification-before-completion` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:writing-plans": {
            "description": "Create detailed implementation plans from specs or requirements",
            "template": "Load the `writing-plans` skill using the `skill` tool, then follow it exactly.",
        },
        "superpower:writing-skills": {
            "description": "Create, edit, and verify skills",
            "template": "Load the `writing-skills` skill using the `skill` tool, then follow it exactly.",
        },
    },
    "mcp": {
        "sequential-thinking": {
            "type": "local",
            "command": [
                "cmd",
                "/c",
                "npx",
                "-y",
                "@modelcontextprotocol/server-sequential-thinking",
            ],
            "enabled": false,
        },
        "filesystem": {
            "type": "local",
            "command": [
                "cmd",
                "/c",
                "npx",
                "-y",
                "@modelcontextprotocol/server-filesystem",
                // "C:\\Users\\admin\\.opencode",
                // "C:\\Users\\admin\\.cache\\opencode",
                // "C:\\Users\\admin\\.config\\opencode",
                // "C:\\Users\\admin\\.local\\share\\opencode",
                // "C:\\Users\\admin\\.local\\state\\opencode",
                // "C:\\Users\\admin\\AppData\\Local\\Temp",
                "C:\\Users\\admin",
                // "D:\\program\\coder\\utils\\bun-windows-x64\\.opencode",
                "D:\\program\\coder\\",
                "D:\\data\\admin",
                "D:\\data\\download",
                "D:\\data\\desktop",
                "D:\\data\\studio",
            ],
            "enabled": true,
        },
        "morph-mcp": {
            "type": "local",
            "command": ["npx", "--prefer-offline", "-y", "@morphllm/morphmcp"],
            "environment": {
                "MORPH_API_KEY": "???",
            },
            "enabled": true,
        },
        "firecrawl-mcp": {
            "type": "local",
            "command": ["npx", "-y", "firecrawl-mcp"],
            "environment": {
                "FIRECRAWL_API_KEY": "???",
            },
            "enabled": false,
        },
        "markitdown": {
            "type": "local",
            "command": ["markitdown-mcp"],
            "enabled": false,
        },
        "chrome-devtools": {
            "type": "local",
            "command": ["npx", "-y", "chrome-devtools-mcp@latest"],
            "enabled": false,
        },
    },
    "compaction": {
        "auto": false,
        "prune": false,
    },
}

magic context 安装

安装 opencode 的前提下执行:

npx @cortexkit/magic-context@latest setup

随后有英文的引导界面,翻译搞完即可。

然后用此命令检查一下:

npx @cortexkit/magic-context@latest doctor

如果有报错或感叹号,多执行几次下面这个命令(直到无报错为止):

npx @cortexkit/magic-context@latest doctor --force

节省 token 的可选安装:rtk

安装网址如下:

https://github.com/rtk-ai/rtk

对于 windows 系统支持有限,建议用 mac 或 linux 或 wsl2 安装 rtk

作用是 cli 代理程序,对命令输出进行过滤和压缩,节省常用的 token 上下文。

浏览器操作能力

出名的有 Playwright(MCP)、Playwright-cli、opencode-browser(plugin)、Agent Reach(工作流)、chrome-devtools(MCP)、Agent Browser(cli)

  1. 首推的是 cli 版本的 Playwright-cli 或 Agent Browser(cli)
  2. 其次是 plugin 版本的 opencode-browser
  3. MCP 版本 token 占用多,但是调用显式,按自己情况来实时开启(比如用 chrome-devtools(MCP) 临时开启进行调试)
  4. Agent Reach(工作流)按需选用

我的 cc 的 oh my opencode slim 截图:

大家也可以将自己的 ai agent 配置 或者 经验心得 分享在评论区!

源码下载地址: https://pan.quark.cn/s/a4b39357ea24 谷歌公司设计了一款无费用且具备开源特性的网络浏览器,名为Chrome,因其卓越的速度、稳定性和安全性而广受赞誉。该浏览器运用了前沿的Web渲染引擎Blink以及JavaScript引擎V8,旨在保障网页载入与脚本运行的卓越效能。为应对无网络环境下的Chrome安装需求,特别准备了离线安装包。此压缩文件内含32位与64位两种规格的Chrome浏览器离线安装方案,具体文件名分别为"chromedev_x64-v68.0.3423.2.exe"与"chromedev_x86-v68.0.3423.2.exe"。在文件命名中,"x64"标识64位版本,适用于64位操作系统平台,而"x86"则对应32位版本,适配32位操作系统。文件名中的"v68.0.3423.2"代表Chrome的一个特定版本号,各版本可能涵盖安全补丁、性能改进或新增功能。与32位Chrome相比,64位版本具备如下长处:能够处理更多内存容量,从而提升多任务作业能力;针对现代硬件的优化使其运行更为迅猛;64位版本更具备高级别的安全防护,能更周全地抵御恶意软件的侵袭。尽管如此,32位版本对于仍在使用32位操作系统的用户,或是在系统资源需求不高的场景下,依然适用。在部署Chrome浏览器时,用户需依据其个人计算机的操作系统平台,挑选匹配的版本进行安装。通过双击相应的.exe文件,安装流程将自动启动,一般包含接受使用许可、确定安装路径及构建桌面快捷方式等环节。若在安装阶段遭遇难题,可参照提示信息或联系技术支援获取协助,同时该压缩文件发布者亦表明欢迎用户以留言形式反映问题。Chrome浏览器的主要特质涵盖:直观的用户界面设计...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值