Skip to content

[FEATURE]: Proposal: TUI Input Changed Hook #6810

@brentlopez

Description

@brentlopez

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

1. Problem Statement

What problem are we solving?

OpenCode plugins currently have no visibility into what users type in the TUI prompt. Plugins can react to messages after submission, but cannot observe or respond to input as it happens. This limits plugin capabilities for features like:

  • Real-time input suggestions
  • Command detection and auto-completion
  • Input validation before submission
  • Context-aware UI hints

Who is affected?

Plugin developers who want to build interactive, responsive plugin experiences. End users who could benefit from smarter input handling.

2. Proposed Solution

Add a new tui.input.changed plugin hook that fires whenever the user types in the TUI prompt. The hook receives the current input text and session ID, enabling plugins to observe typing in real-time.

Key components:

  • New hook type definition in packages/plugin/src/index.ts
  • HTTP endpoint POST /plugin/input-changed in the server
  • Fire-and-forget fetch call from TUI prompt component on input change

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