opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(cli): prevent help text wrapping

Open Patrick-Erichsen opened this issue 1 month ago • 1 comments

Overview

The current opencode -h wraps unnecessarily in a few places ( opencode upgrade [target], opencode pr , --log-level) due to yargs default width:

Screenshot 2025-12-06 at 5 31 00 PM

This makes it harder to skim the text.

Proposed fix

Set .wrap(null) on yargs to prevent wrapping.

Screenshot 2025-12-06 at 5 32 38 PM

The potential drawback here is that the type/choices don't align neatly on the right, but personally I find it easier to read without that alignment.

An alternate solution is to just hardcode the number of cols to wrap on, eg here is .wrap(120) Screenshot 2025-12-06 at 5 34 38 PM

This preserves the right alignment of types/choices but is more brittle.

Patrick-Erichsen avatar Dec 07 '25 01:12 Patrick-Erichsen

I think I like wrap(100) better what do u think

rekram1-node avatar Dec 07 '25 07:12 rekram1-node

+1, I like .wrap(100) - updated 👍

Patrick-Erichsen avatar Dec 07 '25 22:12 Patrick-Erichsen