Skip to content

[FEATURE]: Add a TUI flag/endpoint that auto-submits the initial prompt #3937

@2mawi2

Description

@2mawi2

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

We’re integrating the OpenCode TUI inside our own IDE-style workspace. When a user clicks “start OpenCode,” we launch the CLI in a terminal pane and feed it an initial task so it can begin coding immediately. Other agent CLIs let us do this by piping stdin or using a flag that both injects and submits the first prompt. OpenCode’s --prompt/-p flag only pre-fills the textbox, so the text just sits there until someone manually presses Enter. To work around that, we currently simulate bracketed paste + Enter from outside the process, but that’s brittle and timing-sensitive.

Could you provide a supported way to auto-submit the initial prompt when launching the TUI (e.g., opencode --prompt "…" --auto-submit, or a documented /tui/submit-prompt hook we can call immediately)? That would let IDE integrations start OpenCode sessions deterministically without faking user keystrokes.

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions