Skip to content

About

Some useful patches for Opencode binary

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

opencode-patches

Small, portable patches for the opencode CLI binary.

What it does

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.

Binary resolution

The scripts find the binary in this order:

  1. OPCODE_BIN environment variable
  2. First CLI argument (patch-prompt-height.sh /path/to/opencode.exe)
  3. Auto-detect via command -v opencode (global npm install in PATH)
  4. Interactive prompt (fallback)

Usage

# 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.sh

Examples

Before (default maxHeight:15) vs. patched to 40:

default prompt height 40-line prompt height

About

Some useful patches for Opencode binary

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages