Skip to content

fix(opencode): CLI .fail() handler swallows error message #29390

Description

@zevision

Description

When passing an invalid argument like --unkown-flag, opencode shows the full help text but never tells the user what they did wrong. The error message msg is passed into the .fail() handler but never written to stderr.
Before the fix, opencode --unkown-flag and opencode --help produce identical output — the user has no way to know their argument was wrong.
The issue is in packages/opencode/src/index.ts:181-192. The .fail() handler calls cli.showHelp(show) but never outputs msg.

Plugins

No response

OpenCode version

1.15.10

No response

Steps to reproduce

  1. Run opencode --unkown-flag
  2. Observe there is no error message telling you the argument is unknown
  3. Compare with opencode --help — the output is identical

Screenshot and/or share link

No response

Operating System

Windows 10

Terminal

cmd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions