packages/desktop/README.md
Qwen Code is a desktop and headless agent workspace. It provides multi-session chat, source connections, skills, file previews, automations, and permission modes in a local-first application.
This fork is Qwen-only:
qwen-code.The desktop app talks to the Qwen Code CLI over ACP. Treat the CLI as a
runtime artifact, not as desktop source code. A packaged app must bundle a
known CLI build so users can launch it without installing qwen separately.
Use one of these workflows depending on what you are developing:
| Workflow | Use it when | Commands |
|---|---|---|
| Default desktop development | You are developing desktop only. | bun run dev |
| Published npm package | You want a specific published CLI version for dev, CI, or release builds. | QWEN_CODE_VERSION=0.15.12-acp.0 bun run dev |
| Local npm tarball | You need to verify the exact package contents before publishing. | QWEN_CODE_TARBALL=/path/to/qwen-code-0.15.12-acp.0.tgz bun run dev |
| Local qwen-code checkout | You are changing ACP or other CLI behavior while testing desktop. | QWEN_CODE_ROOT=/path/to/qwen-code bun run dev |
| Explicit CLI entry | You need to point at a specific CLI file. | QWEN_CODE_CLI=/path/to/qwen-code/scripts/dev.js bun run dev |
electron:dev uses local overrides first. If no override is set and this
repository is not inside the qwen-code monorepo, it vendors the default version
from qwenCodeRuntime.version in package.json and points Electron at the
vendored CLI automatically.
If you are preparing a package without publishing it, create the tarball from the Qwen Code repository and point desktop at it:
cd /path/to/qwen-code
npm run build
npm run bundle
npm run prepare:package
npm pack
cd /path/to/desktop
QWEN_CODE_TARBALL=/path/to/qwen-code/qwen-code-0.15.12-acp.0.tgz bun run dist:mac
Distribution builds run electron:vendor:qwen automatically. Set
QWEN_CODE_VERSION or QWEN_CODE_TARBALL when you want the packaged app to use
a published or packed CLI artifact. If neither is set, this monorepo builds
from the local checkout; a standalone desktop checkout uses
qwenCodeRuntime.version from package.json.
Development runtime resolution checks sources in this order:
QWEN_CODE_CLI / QWEN_CODE_ROOT / QWEN_CODE_PATH
QWEN_CODE_TARBALL
QWEN_CODE_VERSION
local monorepo checkout
existing vendored CLI
qwenCodeRuntime.version from package.json
Distribution vendoring checks sources in this order:
QWEN_CODE_TARBALL
QWEN_CODE_VERSION
QWEN_CODE_ROOT / QWEN_CODE_PATH
local monorepo checkout
qwenCodeRuntime.version from package.json
bun install
bun run dev
bun run typecheck:all
bun run test:shared
bun run dev
bun run server:start
All build commands run from packages/desktop/.
.bun-version for exact version)bun install — install all workspace dependenciesUse this for local testing. Produces an ad-hoc signed app.
# macOS (arm64 + x64)
bun run electron:dist:dev:mac
# Windows
bun run electron:dist:dev:win
# Linux
bun run electron:dist:dev:linux
bun run electron:dist:mac
bun run electron:dist:win
bun run electron:dist:linux
Release builds require signing credentials via environment variables:
| Variable | Purpose |
|---|---|
CSC_LINK | Path to signing certificate |
APPLE_ID | Apple ID for notarization |
APPLE_APP_SPECIFIC_PASSWORD | App-specific password |
APPLE_TEAM_ID | Team ID for notarization |
All artifacts are written to apps/electron/release/:
| Platform | Artifact |
|---|---|
| macOS | Qwen-Code-Desktop-{arm64,x64}.dmg, Qwen-Code-Desktop-{arm64,x64}.zip |
| Windows | Qwen-Code-Desktop-x64.exe |
| Linux | Qwen-Code-Desktop-x64.AppImage |
Each electron:dist:* command runs three stages:
electron:vendor:qwen — vendors a Qwen Code CLI runtime into vendor/qwen-code/. Set QWEN_CODE_VERSION to download a published npm version, or QWEN_CODE_TARBALL to use a local npm pack tarball. If neither is set in this monorepo, it builds from the local checkout.electron:build — compiles the app via esbuild (main + preload), Vite (renderer), and copies resources/assets.electron-builder — downloads the Electron runtime, packages the app, signs it, and produces distributable installers (DMG, NSIS, AppImage).bun run apps/cli/src/index.ts run "Hello from Qwen"
bun run apps/cli/src/index.ts run --workspace-dir ./project "Summarize this repo"
The run command spawns a headless server, creates a temporary session, streams the response, and exits. Provider flags are accepted only for compatibility; the backend remains Qwen Code.
apps/
electron/ Desktop app
cli/ Terminal client
webui/ Web adapter
packages/
shared/ Agent, config, prompts, sessions, sources
server-core/ RPC handlers and session manager
core/ Shared types
ui/ Shared UI components
session-tools-core/
session-mcp-server/
scripts/ Build and packaging helpers
Apache 2.0. Third-party dependencies are listed in package manifests and are subject to their respective licenses.