Next Prompt
Predicts your next message after the assistant replies in OpenCode — accept it with the right arrow
2
253
近 7 天 22
38.3
生态多维模型
13 天前
2026-09-22
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-next-prompt@0.1.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-next-prompt@0.1.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-next-promptOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Predicts your next message after the assistant replies and shows it at the prompt — accept it with a keypress (like Claude Code's "next message suggestion").
Requires OpenCode ≥ 2.0 (V2 plugin API).
Install
Add to ~/.config/opencode/cli.json:
{
"plugins": ["opencode-next-prompt"]
}
Restart opencode. The package and its dependencies are installed automatically.
TUI plugins are declared in
cli.json'spluginsarray (the successor oftui.json'spluginarray); thepluginarray inopencode.jsonis for server plugins.
Usage
- After each reply, a suggested next message appears at the input in gray
- Press the accept key (→ by default) while the input is empty to fill it; with text in the input, the key keeps its normal cursor behavior
- Typing hides the suggestion; clearing the input re-shows it
Config
{
"plugins": [
{
"package": "opencode-next-prompt",
"options": {
"acceptKey": "right",
"timeoutMs": 20000,
"model": "my-provider/fast-model",
"includeToolContext": false
}
}
]
}
| Key | Default | Description |
|---|---|---|
acceptKey |
right |
Key to accept the suggestion (only effective while the input is empty) |
timeoutMs |
20000 |
Per-prediction timeout; the timed-out call is aborted and retried once |
model |
unset | Fast model for predictions as provider/model; a bare model id uses the session's provider. Defaults to the current session's model. Unknown providers/models are rejected with an error toast |
variant |
auto | Model variant (reasoning effort) used for predictions. By default the lowest variant the model supports is picked automatically (e.g. low); models without variants are left untouched. Set it explicitly (e.g. "high") to override, or "default" to disable |
includeToolContext |
false |
Include summarized tool calls and outputs in the prediction context (more context, more tokens) |
The accept command is registered as opencode-next-prompt.accept, so it can be rebound in cli.json's keybinds.
How it works
After each reply, the plugin predicts your next input with a single tool-free text-generation call built from the recent conversation (the last few turns plus the original goal). No background session is created, no tools are ever available to the prediction, and the main conversation is never modified. The suggestion is written into the input placeholder, so what you see is exactly what gets accepted.
Each suggestion costs one extra model call. Failed or timed-out predictions are retried once. A suggestion disappears when you type, when you revert or compact the conversation, or when the session changes.
License
MIT
同类生态推荐
Session Recap
@kitlangton/opencode-session-recap
Transient session recaps for the OpenCode V2 TUI
Quotes Tui
opencode-quotes-tui
OpenCode TUI plugin that replaces the home screen tips with a random quote
Aside
opencode-aside
Claude Code's /btw side chat for opencode - ask a one-shot question in an overlay, with no tools and nothing added to the transcript