Repository navigation
feat(v2): open a box from OpenCode, in the terminal, the browser or the OpenCode app - #21
Open
tomasvarga wants to merge 2 commits into
Open
tomasvarga wants to merge 2 commits into
tomasvarga wants to merge 2 commits into
Conversation
- /e2b-attach (TUI plugin): suspends the TUI, runs the box's TUI in the same terminal, resumes on quit with a toast. Loaded from the ./tui export. - /e2b-box open and opencode-e2b box open: one-time sign-in link from opencode pair in the box; opens the browser and copies a second link. - The box runs OpenCode as its background service (pair needs it), opens the project for the web UI, and waits on the API with the password. - /e2b-box up shows progress, copies the link, and passes the local default model; the CLI takes --model.
The OpenCode app folds plugin replies into rows that show about 80 characters, so the first line only says the link is copied.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18. Before this change, you had to quit OpenCode and run
opencode-e2b box attachin a terminal to work in a box. Now you can reach a box from where you already are: your terminal, a browser, or the OpenCode app.What
/e2b-attach [name](new TUI plugin,src/v2/tui.ts): pauses your OpenCode and opens the box's TUI in the same terminal, the same way/editorworks. Quit it (Ctrl+C) to come back. A toast says the box keeps working./e2b-box open [name]andopencode-e2b box open: a one-time sign-in link fromopencode pairin the box. It opens the box's web UI signed in, and copies a second link for the OpenCode app (Settings > Servers > Add server). It also wakes a paused box./e2b-box upshows its progress, copies the sign-in link, and starts the box with your default model. The CLI takes--model <provider/model>.Videos
Terminal:
/e2b-box up,/e2b-attach, detach mid-task, attach again,/continue: the work is done. Thenpullandkill.box-tui.mp4
Browser:
/e2b-box upcopies the link; paste it in a browser.box-browser.mp4
OpenCode app:
/e2b-box upinside the app, then paste the link under Add server. The box shows next to your computer, with its own projects.box-desktop.mp4
How it works
opencode2 service set ...+service start) instead ofopencode2 serve, becauseopencode paironly makes links for the service.GET /api/location, so the web UI shows it one click away./api/infowith the password, not the web page../tuipackage export, from the sameopencode.jsonentry. Users need no extra config.mode: "global". Otherwise the slash command does not show.box/local.tsopens the browser and copies to the clipboard (pbcopy, wl-copy, xclip, clip), as a best effort; the link is always printed too.Tested
bun run check: 103 tests. New tests cover reading the link frompairoutput and choosing the model./continue, pull, kill./e2b-box up, Add server, and a session in the box.--serverclient, stop then open wakes the box, pull.Not in this PR
box listdoes not show them.opencode://link in OpenCode to add a server. Version 2.3.2 does not have one.