[FEATURE]: OpenCode REPL mode, a simpler alternative to the TUI #2883

Open
opened 2026-02-16 17:37:40 -05:00 by yindo · 3 comments
Owner

Originally created by @tnglemongrass on GitHub (Nov 15, 2025).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

This ticket is about exploring the idea of a simpler variant of the interactive TUI mode, that looks and feels closer to using a typical REPL (bash, python, ...):

  • One-dimensional output, relies on the terminal for managing scrollback buffer.
  • Readline-shortcuts, including typical Ctrl-R for backward history search.
  • Prompt-like interaction, alternating between asking for user input and showing output.

Sample Usage / Output

opencode repl
opencode> create a react component
...opencode output...
opencode> add styling with tailwind
...opencode output...
opencode> /exit

The prompt part opencode> might be used to instead show mode (build> ), show additionally model name (build@gpt-5> or gpt-5@build> ), or even context information gpt-5@build[21k/16%]> .

Why?

Mockup with existing functionality opencode run and --continue

  • There are two commands that can already do most of the heavy-lifting:
    • opencode run "first user prompt"
    • opencode run --continue "follow-up user prompts"
Image

This is a small wrapper script opencode-repl.sh that demonstrates what I have in mind:

#!/bin/bash

echo -ne "\033[32mopencode\033[0m> "
read userInput

opencode run "$userInput"

while true; do
    echo -ne "\033[32mopencode\033[0m> "
    read userInput

    if [ "$userInput" = "exit" ]; then
        break
    fi

    opencode run --continue "$userInput"
done

Integration in opencode itself would allow for a much tighter integration though (streaming, mode and model switching, ctrl-c handling, tab-tab preview/completion for slash commands ...).

Originally created by @tnglemongrass on GitHub (Nov 15, 2025). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request This ticket is about exploring the idea of a simpler variant of the interactive TUI mode, that looks and feels closer to using a typical [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) (bash, python, ...): - One-dimensional output, relies on the terminal for managing scrollback buffer. - Readline-shortcuts, including typical Ctrl-R for backward history search. - Prompt-like interaction, alternating between asking for user input and showing output. #### Sample Usage / Output ``` opencode repl ``` ``` opencode> create a react component ...opencode output... opencode> add styling with tailwind ...opencode output... opencode> /exit ``` The prompt part `opencode> ` might be used to instead show mode (`build> `), show additionally model name (`build@gpt-5> ` or `gpt-5@build> `), or even context information `gpt-5@build[21k/16%]> `. #### Why? - Small terminals - Screenreaders - terminal-wrappers [screen](https://en.wikipedia.org/wiki/GNU_Screen)/[tmux](https://de.wikipedia.org/wiki/Tmux), remote ssh, [mosh's instant local echo](https://mosh.org/) feature - IDE-integrated terminals - VSCode's [local echo](https://code.visualstudio.com/docs/terminal/advanced#_reducing-remote-input-latency-preview) terminal feature (e.g. when used in GitHub CodeSpaces) #### Mockup with existing functionality `opencode run` and `--continue` - There are two commands that can already do most of the heavy-lifting: - opencode run "first user prompt" - opencode run --continue "follow-up user prompts" <img width="726" height="286" alt="Image" src="https://github.com/user-attachments/assets/da13d332-87cb-4700-b608-743f1740ccf6" /> This is a small wrapper script `opencode-repl.sh` that demonstrates what I have in mind: ```bash #!/bin/bash echo -ne "\033[32mopencode\033[0m> " read userInput opencode run "$userInput" while true; do echo -ne "\033[32mopencode\033[0m> " read userInput if [ "$userInput" = "exit" ]; then break fi opencode run --continue "$userInput" done ``` Integration in opencode itself would allow for a much tighter integration though (streaming, mode and model switching, ctrl-c handling, tab-tab preview/completion for slash commands ...).
yindo added the discussion label 2026-02-16 17:37:40 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 15, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4294: [FEATURE]: interactive prompts - Requests interactive UI elements like checkboxes and inputs for better question/answer flow
  • #4184: [FEATURE]: Interactive Queries From LLM based on ambiguities - Similar concept of interactive clarifications during conversations
  • #4280: [FEATURE]: bash completions - Requests tab completions for terminal-based tool, relates to REPL-like terminal experience
  • #4070: [FEATURE]:re-enable emacs-style prompt navigation - Requests readline-style navigation (Ctrl+A, Ctrl+E, etc.) similar to what REPL mode would provide
  • #4092: [FEATURE]: better navigation of output, alternative vim mode and non-blocking agent permission requests - Discusses alternative interaction modes and better keyboard navigation
  • #4143: Ctrl+A and Ctrl+E should move to beginning/end of line, not buffer - Standard readline keybindings that would be part of REPL functionality
  • #4144: Ctrl+N and Ctrl+P should move the cursor up and down one line - More readline-style navigation features

While these issues address related aspects like interactive prompts, readline navigation, and alternative interaction modes, your REPL mode request is more comprehensive and focused on a simpler, one-dimensional terminal-based interface.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 15, 2025): This issue might be a duplicate of existing issues. Please check: - #4294: [FEATURE]: interactive prompts - Requests interactive UI elements like checkboxes and inputs for better question/answer flow - #4184: [FEATURE]: Interactive Queries From LLM based on ambiguities - Similar concept of interactive clarifications during conversations - #4280: [FEATURE]: bash completions - Requests tab completions for terminal-based tool, relates to REPL-like terminal experience - #4070: [FEATURE]:re-enable emacs-style prompt navigation - Requests readline-style navigation (Ctrl+A, Ctrl+E, etc.) similar to what REPL mode would provide - #4092: [FEATURE]: better navigation of output, alternative vim mode and non-blocking agent permission requests - Discusses alternative interaction modes and better keyboard navigation - #4143: Ctrl+A and Ctrl+E should move to beginning/end of line, not buffer - Standard readline keybindings that would be part of REPL functionality - #4144: Ctrl+N and Ctrl+P should move the cursor up and down one line - More readline-style navigation features While these issues address related aspects like interactive prompts, readline navigation, and alternative interaction modes, your REPL mode request is more comprehensive and focused on a simpler, one-dimensional terminal-based interface. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 16, 2025):

Yeah we've talked about this one before internally

@rekram1-node commented on GitHub (Nov 16, 2025): Yeah we've talked about this one before internally
Author
Owner

@Sleepful commented on GitHub (Jan 14, 2026):

+1, the current TUI implementation makes it impossible for my friend to use OpenCode because the TUI is really poor UX with assistive technologies.

@Sleepful commented on GitHub (Jan 14, 2026): +1, the current TUI implementation makes it impossible for my friend to use OpenCode because the TUI is really poor UX with assistive technologies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2883