Skip to content

feat(opencode): add desktop command for deep-linking into desktop app#15479

Open
anduimagui wants to merge 3 commits intoanomalyco:devfrom
anduimagui:feat/cli-open-command
Open

feat(opencode): add desktop command for deep-linking into desktop app#15479
anduimagui wants to merge 3 commits intoanomalyco:devfrom
anduimagui:feat/cli-open-command

Conversation

@anduimagui
Copy link

@anduimagui anduimagui commented Feb 28, 2026

Issue for this PR

Closes #15477
References #13534, #11666, #14570

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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?

  • Ran bun run --cwd packages/opencode src/index.ts desktop --help and confirmed command registration/output.
  • Ran packages/opencode/dist/opencode-darwin-arm64/bin/opencode desktop /Users/andrew/Documents/GitHub/defra-code and confirmed invocation succeeds.
  • Ran bun test --preload ./happydom.ts ./src/context/server.test.ts from packages/app.
  • Verified dedupe logic change in server.projects.open now compares normalized worktree values.

Screenshots / recordings

N/A (CLI + logic change)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@anduimagui anduimagui changed the title feat(opencode): add desktop command for opening desktop app feat(opencode): add desktop command for deep-linking into desktop app Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add opencode desktop [path] command

2 participants