opencode icon indicating copy to clipboard operation
opencode copied to clipboard

OpenCode Desktop app

Open Brendonovich opened this issue 1 month ago • 0 comments

Adds @opencode-ai/desktop to @opencode-ai/tauri, with CI setup for building and uploading assets as debug artifacts and as release assets. The Tauri app embeds the opencode binary as a sidecar, and runs it as a child process. A summary of changes in no particular order:

  • @opencode-ai/desktop is now consumable as a library, exporting both runtime code and config
    • I've given the package it's own /vite export so that any plugins and config can be shared between its consumers' Vite configs
  • Running bun tauri dev in packages/tauri will now performing the following preparation steps:
    • An opencode binary for the specified target will be searched for in packages/opencode/dist/{target}/bin
    • If no binary is found, bun run build --single will be used to build the binary for the current target (this doesn't yet support building a specific target)
    • The binary will be copied into packages/tauri/src-tauri/binaries
  • CI now builds Desktop for x86_64-apple-darwin, aarch64-apple-darwin, x86_64-pc-windows-msvc, and x86_64-unknown-linux-gnu
    • This happens after the CLI release completes
    • packages/tauri/scripts/prepare.ts is used to download the opencode binary for the specified target
    • The updater currently uses OS dialogs for checking for updates on startup, see here for how to have more control over it
    • The updater currently sources updates from GitHub releases, this can be changed to be your own domain or update server
    • The version number from the app is being pulled from packages/tauri/package.json

Pending tasks and questions:

  • [ ] tauri-action will require a releaseId to upload assets to, right now I have it set to create a draft release
  • [ ] Should the CI flow be redesigned so that release doesn't complete until the desktop app is ready?
  • [x] Generate a public/provide key for the updater
  • [ ] macOS Codesigning: Requires APPLE_CERTIFICATE and APPLE_CERTIFICATE_PASSWORD
  • [ ] macOS Notarization: Requires APPLE_API_ISSUER, APPLE_API_KEY, and the contents of the corresponding private key

Brendonovich avatar Dec 04 '25 05:12 Brendonovich