anomalyco / anomalyco/opencode
Exit-screen resume command always says "opencode", even when invoked as opencode2
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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
- Install `@opencode/cli` such that it's available as `opencode2` in PATH (e.g. because `opencode` already points at a separate v1 install).
- Run `opencode2` and start an interactive session.
- Exit the session.
- The exit screen prints `Continue opencode --mini -s ses_...` instead of `opencode2 --mini -s ses_...`.
- Running the printed command invokes the wrong binary and can't resume the session.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100