Skip to content

Opencode Prompt

The opencode-like input on an accent rail, with the mode and model on a line under the text, such as Build · Qwen3 Coder.

On this page

Examples

The shared grammar with the look fixed: the same as <CliPrompt preset="opencode-like" />, so it reads as the opencode-like look on its own or inside a session. Every part in all eight looks is on Agent CLI.

Installation

npx knowns-ui@latest add agent-cli-opencode
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

value / defaultValue / onValueChange
string
Default""
The text, controlled or not. A still value such as "/he" shows the menu open.
onSubmit / onCommand
(text) => void / (name) => void
A line sent, a command taken. Without either the prompt is read only.
commands
{ name, args?, description? }[]
DefaultDEFAULT_COMMANDS
The slash menu's commands.
menu / menuRows
ComponentType / number
Defaultthis look's menu / 6
Another menu component, and how many rows it shows.
placeholder / readOnly / caret
string / boolean / boolean
The placeholder, read only, and a block caret after the text.
model / mode / modes / onModeChange
string / string / string[] / (mode) => void
Shown where the look prints them; Shift+Tab cycles modes.

When to use

When to use

  • An input a reader can try on an opencode-like demo screen.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Opencode Prompt to my app and wire it to my own data.
  • I need an input a reader can try on an opencode-like demo screen. Set that up with the Knowns UI Opencode Prompt.
  • Which Opencode Prompt props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "opencode-prompt" }) and search_docs({ query: "opencode prompt" }).

Need help?

Stuck on Opencode Prompt, or found something off? We read every message.