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

    Queue

    v0.12.2工具与命令
    opencode-queue

    Queue OpenCode prompts and slash commands until the agent is idle

    GitHub 星标

    15

    近 30 天 +1

    月装机量

    924

    近 7 天 115

    综合评分SCORE

    49.7

    生态多维模型

    最近提交

    10 天前

    2026-08-09

    快速安装与配置

    opencode.json

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

    opencode.json

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

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

    npm version CI npm downloads

    Queue OpenCode input until the current session is idle.

    opencode-queue adds a real /queue slash command. It lets you type the next prompt, slash command, or shell command while an agent is still working, without interrupting the current run.

    Install

    Add the plugin to your OpenCode config:

    {
      "plugin": ["opencode-queue"]
    }
    

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

    Quick Examples

    /queue continue after this task
    continue after this task /queue
    /queue front do this next
    do this next /queue front
    
    /queue /review
    /review /queue
    /queue front /review
    /review /queue front
    
    /queue /compact
    /queue front /compact
    
    /queue !ls
    /queue front !pwd
    
    /queue list
    /queue stop
    /queue start
    /queue flush
    /queue clear
    /queue clear 1
    /queue clear 2 3
    

    Syntax

    Input What it does
    /queue message Queue a normal prompt.
    message /queue Queue a normal prompt using trailing syntax.
    /queue front message Queue a normal prompt before existing queued entries.
    message /queue front Queue a normal prompt before existing queued entries using trailing syntax.
    /queue /review Queue a slash command.
    /review /queue Queue a slash command using trailing syntax.
    /queue front /review Queue a slash command before existing queued entries.
    /review /queue front Queue a slash command before existing queued entries using trailing syntax.
    /queue /compact Queue OpenCode's built-in TUI /compact command.
    /queue front /compact Queue OpenCode's built-in TUI /compact command before existing queued entries.
    /queue !ls Queue an OpenCode shell block.
    /queue front !ls Queue an OpenCode shell block before existing queued entries.
    /queue Show the current queue.
    /queue list Show the current queue.
    /queue stop Pause automatic sending of queued entries.
    /queue start Resume automatic sending of queued entries.
    /queue flush Send all queued entries immediately.
    /queue clear Clear the current queue.
    /queue clear 1 Clear item 1 from the current queue.
    /queue clear 2 3 Clear items 2 and 3 from the current queue.

    Behavior

    When the session is busy:

    • Queued entries are hidden from the transcript and from the running agent.
    • The current agent run keeps using its original agent, model, and thinking variant.
    • Each queued entry replays with the agent, model, and thinking variant selected when it was queued.
    • Queued entries replay in order after the session completes normally and becomes idle.
    • /queue front ... puts an entry before the existing queued entries.
    • Only one queued entry is sent per idle transition, so queued work runs one item at a time.
    • Queued entries are kept in place after an error, abort, crash, or restart.
    • /queue stop pauses automatic replay without clearing queued entries, and /queue start resumes it.
    • /queue flush sends all queued entries immediately in one batch, even before the session is idle.

    When the session is idle:

    • /queue message sends message immediately.
    • message /queue sends message immediately.
    • /queue /review runs /review immediately.
    • /review /queue runs /review immediately.
    • /queue /compact runs OpenCode's built-in TUI /compact command immediately.
    • /queue !ls runs ls immediately as an OpenCode shell block.
    • /queue and /queue list show the current queue.
    • /queue stop pauses automatic replay, and /queue start resumes it.
    • /queue flush sends all queued entries immediately in one batch.
    • /queue clear clears the current queue, and /queue clear 1 clears a specific queued item.

    Queue Management

    /queue
    /queue list
    /queue stop
    /queue start
    /queue flush
    /queue clear
    /queue clear 1
    /queue clear 2 3
    

    Queues are scoped to the current project and session. They are stored in OpenCode's user data directory and restored with their previous running or stopped state after OpenCode restarts or crashes. Restored queues do not replay just because the session starts idle; a running queue resumes after the session becomes busy and then finishes successfully. A send interrupted by a crash remains queued because the plugin cannot know whether OpenCode accepted it before exiting.

    Notes

    • This plugin registers /queue as a real OpenCode slash command.
    • It does not add a keyboard shortcut. OpenCode plugins cannot currently register custom TUI keybindings.
    • Queued placeholders are hidden instead of deleted, then filtered out before messages are sent to the model.
    • If plan mode asks to switch to the build agent while more queued work is waiting, the plugin answers No so the queue can continue.