Exit-screen resume command always says "opencode", even when invoked as opencode2

Open Beginner friendly
#49,764 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Start in packages/opencode/src/cli/cmd/run/splash.ts and inspect the build() function's exit branch, along with how the launched command name is available there. Make the resume hint use the invoked binary name instead of hardcoding opencode, then verify the exit screen when launching through opencode2.

Written by the indexing model from the issue text.

Description

2.0
Description

The published `@opencode/cli` package registers this binary under two bin names, `opencode` and `opencode2` (so a v2 install doesn't clobber a separately installed v1 `opencode`). When you exit an interactive session, the exit splash prints a resume command to copy-paste, but it always hardcodes the literal string `opencode --mini -s `, regardless of which name you actually launched the binary with.

If `opencode` in your PATH resolves to something else (e.g. a separate v1 install, as in my case), the printed resume command runs the wrong binary and fails to find the session — the hint should say `opencode2 --mini -s ` when that's how it was invoked.

The hardcoded string is in `packages/opencode/src/cli/cmd/run/splash.ts` (the `build()` function's "exit" branch).

Plugins

opencode-pty, oh-my-opencode-slim

OpenCode version

2.0.7 (installed as `opencode2`)

Steps to reproduce
  1. Install `@opencode/cli` such that it's available as `opencode2` in PATH (e.g. because `opencode` already points at a separate v1 install).
  2. Run `opencode2` and start an interactive session.
  3. Exit the session.
  4. The exit screen prints `Continue opencode --mini -s ses_...` instead of `opencode2 --mini -s ses_...`.
  5. Running the printed command invokes the wrong binary and can't resume the session.
Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 20m
Merged PRs (30d)
358

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.