Cannot use messages starting with - with opencode run #3202

Closed
opened 2026-02-16 17:39:05 -05:00 by yindo · 1 comment
Owner

Originally created by @ucirello on GitHub (Nov 29, 2025).

Description

It seems that opencode run doesn't correctly interpret messages starting with -, it treats the leading dash as an indicator of flag.

Unlike other Unix-style CLI tools, prefacing dash-leading positional arguments with -- doesn't work.

OpenCode version

1.0.120

Steps to reproduce

  1. Run opencode run '-hello world'

Screenshot and/or share link

No response

Operating System

macOS

Terminal

iTerm2

Originally created by @ucirello on GitHub (Nov 29, 2025). ### Description It seems that `opencode run` doesn't correctly interpret messages starting with `-`, it treats the leading dash as an indicator of flag. Unlike other Unix-style CLI tools, prefacing dash-leading positional arguments with `--` doesn't work. ### OpenCode version 1.0.120 ### Steps to reproduce 1. Run `opencode run '-hello world'` ### Screenshot and/or share link _No response_ ### Operating System macOS ### Terminal iTerm2
yindo added the opentuibug labels 2026-02-16 17:39:05 -05:00
yindo closed this issue 2026-02-16 17:39:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 29, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4796: opencode --prompt commands not working (closed) - Similar issue with yargs treating arguments as flags
  • #4700: opencode --prompt does not begin the session (open) - Related to command-line argument parsing with special characters

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 29, 2025): This issue might be a duplicate of existing issues. Please check: - #4796: opencode --prompt commands not working (closed) - Similar issue with yargs treating arguments as flags - #4700: opencode --prompt does not begin the session (open) - Related to command-line argument parsing with special characters Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3202