You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Codex-style long-running goal mode for OpenCode.
4
4
5
5
This plugin adds:
6
6
7
-
-`/goal` in the OpenCode TUI.
7
+
-`/goal <objective>` as an OpenCode command for TUI, desktop, and web.
8
8
- A sidebar goal indicator with status, elapsed time, token usage, remaining budget, and objective.
9
9
- Agent tools: `get_goal`, `create_goal`, `update_goal`, and `clear_goal`.
10
10
- Goal close evidence: `complete` requires verified evidence, and `unmet` requires a concrete blocker.
@@ -60,7 +60,8 @@ Server options can be configured in `opencode.json`:
60
60
{
61
61
"auto_continue": true,
62
62
"max_auto_turns": 25,
63
-
"min_continue_interval_seconds": 3
63
+
"min_continue_interval_seconds": 3,
64
+
"default_token_budget": null
64
65
}
65
66
]
66
67
]
@@ -72,18 +73,23 @@ Defaults:
72
73
-`auto_continue`: `true`
73
74
-`max_auto_turns`: `25`
74
75
-`min_continue_interval_seconds`: `3`
76
+
-`register_command`: `true`
77
+
-`command_name`: `"goal"`
78
+
-`default_token_budget`: `null`
75
79
76
80
## Goal Workflow
77
81
78
-
Use `/goal` from an OpenCode TUI session to set, refresh, or clear the goal. New goals support budget presets:
82
+
Use `/goal <objective>` in a fresh OpenCode chat to create a long-running goal:
79
83
80
-
- No budget
81
-
-`250K`
82
-
-`1M`
83
-
-`2M`
84
-
- Custom positive integer
84
+
```text
85
+
/goal review the frontend and translate visible English UI text to Spanish
86
+
```
87
+
88
+
Bare `/goal` reports the current goal state. `/goal clear` clears the goal. The TUI also includes a `Goal` command-palette entry for viewing, refreshing, or clearing the current goal state without creating a new goal.
89
+
90
+
By default, `/goal <objective>` omits `token_budget`, matching Codex TUI behavior. If you want every new slash-created goal to use a fixed token budget without prompting the user, set `default_token_budget` to a positive integer in `opencode.json`.
85
91
86
-
When setting the objective, include the scope, non-goals, and verification path when they matter. The agent is reminded to audit real files, command output, tests, or PR state before closing the goal.
92
+
When writing the objective, include the scope, non-goals, and verification path when they matter. The agent is reminded to audit real files, command output, tests, or PR state before closing the goal.
87
93
88
94
The `update_goal` tool can close a goal in two ways:
? "By default, omit token_budget. This matches Codex TUI behavior for /goal <objective>."
55
+
: `By default, pass token_budget: ${defaultTokenBudget} when creating a goal unless the user explicitly requests a different token budget or no budget.`
56
+
57
+
return`OpenCode goal mode command "/${commandName}" was invoked.
58
+
59
+
Arguments:
60
+
<goal_command_arguments>
61
+
$ARGUMENTS
62
+
</goal_command_arguments>
63
+
64
+
Use the goal tools to handle this command:
65
+
66
+
- If the arguments are empty, call get_goal and briefly report the current goal state.
67
+
- If the arguments are "status", "show", or "current", call get_goal and briefly report the current goal state.
68
+
- If the arguments are "clear", call clear_goal and report whether a goal was cleared.
69
+
- If the arguments start with "complete " or "done ", perform a completion audit against real artifacts and command output. Call update_goal with status "complete" only if the goal is achieved, using concise evidence from the audit.
70
+
- If the arguments start with "unmet ", "blocked ", or "blocker ", call update_goal with status "unmet" only when the goal cannot be achieved or needs external input, using the remaining arguments as the blocker.
71
+
- Otherwise, create a new goal with create_goal. Use the full arguments as the objective. ${defaultBudgetInstruction}
72
+
- Set token_budget only from this default or when the arguments explicitly include a token budget such as "--budget 250000", "budget=250000", or "token_budget=250000".
73
+
74
+
Create a goal only from these explicit command arguments. Do not infer a goal from unrelated session context. After create_goal succeeds, continue working toward the new goal.`
0 commit comments