

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Prompting
incomplete
2: Plan Agent
incomplete
3: Canceling
incomplete
4: Steering
incomplete
5: The Prompt Box
incomplete
6: Queueing
incomplete
7: Prompt Examples
incomplete
8: Speech to Text
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
OpenCode's prompt box does more than just accept raw text. It has some nice ergonomic features that are worth knowing about.
Type @ and start typing a filename. OpenCode will open a menu you can navigate with the arrow keys, then you can press Enter to attach it. For example:
Explain how functions work in @docs/spec.md
Selecting a text file has OpenCode read it into your prompt. That saves the model from having to request a read-file tool call, though large files can be truncated.
Some default TUI shortcuts include:
VISUAL, or EDITOR if VISUAL isn't set). Save and close the editor; OpenCode reads the draft back when the editor process exits. GUI editors need a wait flag, such as code --wait.You can paste text normally into the prompt box. By default, long pastes appear as a compact label. Don't worry, OpenCode still gets the full text.
By default, selecting text with the mouse in the TUI copies it to your clipboard. You'll see a "Copied to clipboard" toast when it succeeds.
Type ! at the start of an empty prompt to enter shell mode. It runs a shell command directly, without asking the model to run it. It's useful for quick commands, not interactive terminal programs.
That said, the command and its output become part of the session, so your next prompt can refer to the result. You can use Esc to leave shell mode without running anything.
Create a doubling example using the prompt box. This SlopLang code doubles a number and prints the result:
clanker double(number) {
ship number * 2✨
}
hallucinate(double(21))✨ — prints 42
Tell OpenCode to run and submit the CLI tests from the project root.