跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    mirsella

    Goal

    v0.4.3其他
    opencode-goal

    Add Codex-style long-running goals to OpenCode

    GitHub 星标

    9

    月装机量

    204

    近 7 天 38

    综合评分SCORE

    40.1

    生态多维模型

    最近提交

    1 个月前

    2026-07-04

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-goal@0.4.3"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    npm version CI npm downloads license: MIT

    OpenCode server plugin that adds Codex-style /goal behavior for long-running tasks.

    Commands

    • /goal: show the current goal or Usage: /goal <objective> if none exists.
    • /goal <objective>: set or replace the active goal without resetting its elapsed-time stats.
    • /goal append <text>: append text to the active goal without resetting its elapsed-time stats.
    • /goal pause: pause auto-continuation.
    • /goal resume: resume auto-continuation.
    • /goal clear: remove the goal.

    Active goals auto-continue when the session becomes idle. The continuation prompt is based on Codex's goal prompt with all token and budget handling removed.

    Tool

    The plugin exposes update_goal({ status: "complete" }) only while at least one active goal exists, so inactive sessions do not carry extra tool context.

    State

    Goal state is saved to disk per session and restored when the OpenCode process restarts. By default it is stored under $XDG_STATE_HOME/opencode-goal or ~/.local/state/opencode-goal; set OPENCODE_GOAL_STATE_FILE to override the state file path. Only wall-clock active time is tracked. Token usage and token budgets are intentionally not tracked or mentioned.

    Install

    Add the npm plugin to your OpenCode config:

    "plugin": [
      "opencode-goal",
    ]
    

    Restart OpenCode after installing. OpenCode installs npm plugins automatically at startup.

    Checks

    bun install
    bun test
    bunx tsc --noEmit
    

    Known Gaps

    • OpenCode server plugins do not expose Codex's replace-confirmation menu, so /goal <objective> replaces immediately.
    • Plan-mode suppression is best effort because plugin events do not always expose the active mode.
    • Continuation prompt injection uses OpenCode's experimental message transform hook.