Small, portable patches for the opencode CLI binary.
patch-prompt-height.sh edits the compiled opencode binary to raise the
input prompt's maxHeight (the maximum number of visible lines in the prompt
box). The default is 15; the script rewrites the embedded
maxHeight:<value> token to a value you choose (10–99).
restore-prompt-height.sh restores the original binary from the .bak
backup created by the patch script.
No system-specific paths are hardcoded — the scripts locate the binary automatically, so they work on any machine.
The scripts find the binary in this order:
OPCODE_BINenvironment variable- First CLI argument (
patch-prompt-height.sh /path/to/opencode.exe) - Auto-detect via
command -v opencode(global npm install inPATH) - Interactive prompt (fallback)
# Patch — the binary is auto-detected from PATH.
# You'll be asked for the new maxHeight (default 30).
./patch-prompt-height.sh
# Patch a custom path / non-PATH install:
OPCODE_BIN=/opt/opencode/bin/opencode.exe ./patch-prompt-height.sh
./patch-prompt-height.sh /opt/opencode/bin/opencode.exe
# Restore the original binary:
./restore-prompt-height.shBefore (default maxHeight:15) vs. patched to 40:

