feat(opencode): add desktop command for deep-linking into desktop app#15479
Open
anduimagui wants to merge 3 commits intoanomalyco:devfrom
Open
feat(opencode): add desktop command for deep-linking into desktop app#15479anduimagui wants to merge 3 commits intoanomalyco:devfrom
desktop command for deep-linking into desktop app#15479anduimagui wants to merge 3 commits intoanomalyco:devfrom
Conversation
Add to launch the desktop app via deep link and normalize worktree paths when opening projects so trailing slash variants do not create duplicate project entries.
Add normalizeWorktree tests for trailing separators and root paths, harden normalizeWorktree root handling, and rename the desktop CLI command module from open.ts to desktop.ts for command/file consistency.
desktop command for deep-linking into desktop app
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.
Issue for this PR
Closes #15477
References #13534, #11666, #14570
Type of change
What does this PR do?
Adds a dedicated
opencode desktop [path]command that deep-links into the desktop app with a specific local directory.It also normalizes worktree path comparisons in server project open logic by trimming trailing slashes before matching, so the same directory path variant does not get added twice.
Related prior work: this is inspired by #10072, which added desktop deep-link support in the app/desktop layers. This PR is different because it adds a CLI entrypoint for that capability (
opencode desktop) and tightens path matching to avoid duplicate project entries from path variants.How did you verify your code works?
bun run --cwd packages/opencode src/index.ts desktop --helpand confirmed command registration/output.packages/opencode/dist/opencode-darwin-arm64/bin/opencode desktop /Users/andrew/Documents/GitHub/defra-codeand confirmed invocation succeeds.bun test --preload ./happydom.ts ./src/context/server.test.tsfrompackages/app.server.projects.opennow compares normalized worktree values.Screenshots / recordings
N/A (CLI + logic change)
Checklist