You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: opencode://new-session in OpenCode 2's desktop app, as in OpenCode 1 #55106
OpenCode 1's desktop app handled opencode://new-session?directory=<dir>&prompt=<text>. A setup command could sign the user in and then open a new session in their project, on the configured model, with a first message.
OpenCode 2's desktop app (v2.0.27) still registers opencode://, but reads only opencode://console/authorized (packages/desktop/src/main/.../deep-link.ts). Every other link is passed to the page as window.__OPENCODE__.deepLinks and an opencode:deep-link event, and nothing in packages/app reads either. The app then reopens its window's last-active-url. There are no launch arguments for a directory or a new session either.
Ask: handle opencode://new-session?directory=&prompt= again (an optional model= would help too), opening a new draft session in that directory.
Related: #53529 (open existing sessions as Desktop tabs from API clients).
To restate it: you'd like the OpenCode 2 desktop app to handle opencode://new-session?directory=<dir>&prompt=<text> again, ideally with an optional model=, and open a new draft session in that directory with the prompt filled in, the way OpenCode 1 did. That would let a setup command sign the user in and then drop them straight into their project.
I checked, and it matches what you found. On v2 the desktop app only handles opencode://console/authorized. Other links reach the page, but nothing acts on them yet. This can't be done with a plugin either, because handling the link happens in the desktop app, not in the server where plugins run. Maintainers will consider it.
open "opencode://new-session?directory=$HOME/code/hex&prompt=hello%20from%20hex"
The app comes to the front, but it reopens the last-used project on an empty new-session view. The directory and prompt are both dropped, whether the app was already running or not.
Another use case: Hex's Output pane wants an "Edit with agent" button that opens a fresh OpenCode session with a prompt already typed in but not sent (anomalyco/hex#789). This link, opening a draft rather than sending, is exactly what it needs.
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed request, @Xrpfant!
To restate it: you'd like the OpenCode 2 desktop app to handle
opencode://new-session?directory=<dir>&prompt=<text>again, ideally with an optionalmodel=, and open a new draft session in that directory with the prompt filled in, the way OpenCode 1 did. That would let a setup command sign the user in and then drop them straight into their project.I checked, and it matches what you found. On v2 the desktop app only handles
opencode://console/authorized. Other links reach the page, but nothing acts on them yet. This can't be done with a plugin either, because handling the link happens in the desktop app, not in the server where plugins run. Maintainers will consider it.Related issues and PRs:
opencode://session/<id>to the v2 desktop app (same deep-link handling)opencode://add-mcpdeep linknew-sessionlinks, from before OpenCode 2ahatzz11 commentedon Nov 1, 2026
Still the case in desktop 2.2.5 on macOS:
The app comes to the front, but it reopens the last-used project on an empty new-session view. The
directoryandpromptare both dropped, whether the app was already running or not.Another use case: Hex's Output pane wants an "Edit with agent" button that opens a fresh OpenCode session with a prompt already typed in but not sent (anomalyco/hex#789). This link, opening a draft rather than sending, is exactly what it needs.