CLI --version prints log line before version #7771

Closed
opened 2026-02-16 18:08:11 -05:00 by yindo · 3 comments
Owner

Originally created by @chhoumann on GitHub (Jan 27, 2026).

Originally assigned to: @rekram1-node on GitHub.

Summary

opencode --version prints a log line before the version string, which breaks scripts that parse version output.

Steps to Reproduce

  1. Run opencode --version (installed CLI)

Expected

A single version line on stdout, no stderr.

Actual

A models.dev refresh log line appears before the version:

$ opencode --version
INFO  2026-01-27T16:09:15 +31ms service=models.dev file={} refreshing
1.1.36

Proof (after fix)

Built CLI outputs only the version and no stderr:

$ ./packages/opencode/dist/opencode-darwin-arm64/bin/opencode --version >/tmp/opencode_version_out.txt 2>/tmp/opencode_version_err.txt
$ wc -l /tmp/opencode_version_out.txt /tmp/opencode_version_err.txt
1 /tmp/opencode_version_out.txt
0 /tmp/opencode_version_err.txt
$ cat /tmp/opencode_version_out.txt
0.0.0-dev-202601271843

Environment

  • OS: macOS arm64
  • CLI version observed: 1.1.36
Originally created by @chhoumann on GitHub (Jan 27, 2026). Originally assigned to: @rekram1-node on GitHub. ### Summary `opencode --version` prints a log line before the version string, which breaks scripts that parse version output. ### Steps to Reproduce 1. Run `opencode --version` (installed CLI) ### Expected A single version line on stdout, no stderr. ### Actual A models.dev refresh log line appears before the version: ``` $ opencode --version INFO 2026-01-27T16:09:15 +31ms service=models.dev file={} refreshing 1.1.36 ``` ### Proof (after fix) Built CLI outputs only the version and no stderr: ``` $ ./packages/opencode/dist/opencode-darwin-arm64/bin/opencode --version >/tmp/opencode_version_out.txt 2>/tmp/opencode_version_err.txt $ wc -l /tmp/opencode_version_out.txt /tmp/opencode_version_err.txt 1 /tmp/opencode_version_out.txt 0 /tmp/opencode_version_err.txt $ cat /tmp/opencode_version_out.txt 0.0.0-dev-202601271843 ``` ### Environment - OS: macOS arm64 - CLI version observed: 1.1.36
yindo closed this issue 2026-02-16 18:08:11 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

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

  • #10686: Annoying logging info for model refreshing (reports the exact same issue with models.dev refresh log appearing on --version output)
  • #10781: attach client should not refresh models.dev on every connection (same root cause - unwanted models.dev refreshing log output)
  • #8203: opencode run hangs forever on API errors (related: breaking CLI/automation integrations due to unexpected output)
  • #6999: [FEATURE]: Quiet mode for CLI runs (related: request to suppress unwanted output in CLI usage)

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

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #10686: Annoying logging info for model refreshing (reports the exact same issue with models.dev refresh log appearing on --version output) - #10781: attach client should not refresh models.dev on every connection (same root cause - unwanted models.dev refreshing log output) - #8203: opencode run hangs forever on API errors (related: breaking CLI/automation integrations due to unexpected output) - #6999: [FEATURE]: Quiet mode for CLI runs (related: request to suppress unwanted output in CLI usage) Feel free to ignore if none of these address your specific case.
Author
Owner

@neriousy commented on GitHub (Jan 27, 2026):

It's already fixed in dev I believe

@neriousy commented on GitHub (Jan 27, 2026): It's already fixed in dev I believe
Author
Owner

@chhoumann commented on GitHub (Jan 27, 2026):

You're right @neriousy - this was fixed in e49306b86c

@chhoumann commented on GitHub (Jan 27, 2026): You're right @neriousy - this was fixed in e49306b86c490faf42f5ffcd7701a89329ea7f28
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7771