Back to Qwen Code

@qwen-code/qwen-live

packages/qwen-live/README.md

0.23.05.3 KB
Original Source

@qwen-code/qwen-live

Standalone Live voice daemon: a realtime voice control plane that orchestrates coding sessions through voice.

qwen-live connects three parties:

  • Live Host (the macOS overlay app) over the Live Host WebSocket protocol v7 — writes ~/.qwen/live/daemon.json for discovery, so an already-installed Host connects automatically.
  • A DashScope realtime voice model (qwen-omni realtime) that owns the conversation: VAD, direct answers, and a tool surface for dispatching work to coding sessions.
  • Coding sessions through a BackendAdaptor. Two adaptors are available: one drives qwen serve over REST/SSE, and one spawns any ACP-compatible agent (qwen --acp, qodercli --acp, gemini --acp, etc.) as a child process over JSON-RPC stdio. Multiple backends can coexist with per-session routing.

The live session itself is fully owned by this daemon (JSONL logs under ~/.qwen-live/sessions/); backend sessions are ordinary coding sessions that keep running after a call ends.

Quick Start

1. Install

bash
# From the qwen-code monorepo
cd qwen-code
npm install && npm run build

2. Run the setup wizard

bash
node packages/qwen-live/dist/index.js init

The wizard will:

  • Scan your PATH for installed coding agents (qodercli, qwen, gemini, claude, codex) and list what it found
  • Let you pick a default backend and add additional ones
  • Ask for your DashScope realtime API key
  • Set a default working directory for coding sessions
  • On macOS: check if the Live Host app is installed and offer to install it

When done, it writes ~/.qwen-live/config.json and tells you to run qwen-live to start.

3. Start the daemon

bash
qwen-live
# → qwen-live listening on http://127.0.0.1:<port>

On macOS, open the Live Host app — it reads the discovery file and connects automatically. Press the global shortcut to start a voice call.

On other platforms: the Live Host app is macOS-only (it needs native microphone, global shortcut, and screen capture). Linux/Windows users cannot use voice features until a Host is available on their platform.

Configuration

Configuration comes from ~/.qwen-live/config.json (generated by init), with environment variables (DASHSCOPE_API_KEY, QWEN_LIVE_*) as overrides.

jsonc
{
  "realtimeApiKey": "sk-...",
  "defaultCwd": "~/work/my-project",
  "backends": [
    {
      "name": "qodercli",
      "kind": "acp",
      "command": "/usr/local/bin/qodercli",
      "args": ["--acp"],
      "default": true,
    },
    {
      "name": "qwen",
      "kind": "acp",
      "command": "/usr/bin/qwen",
      "args": ["--acp"],
    },
  ],
}

See src/config.ts for the full list of options and validation rules.

Supported backends

BackendKindACP entryNotes
Qoder CLIacpqodercli --acpHidden flag; uses Qoder's own login
Qwen Codeacpqwen --acpNative ACP mode
Gemini CLIacpgemini --experimental-acpOfficial ACP support
Claude Codeacpnpx @agentclientprotocol/claude-agent-acpAdapter-based
Codexacpnpx @agentclientprotocol/codex-acpAdapter-based
qwen serveqwen-codeREST/SSE to qwen serve daemonLegacy; no ACP needed

Multiple backends can coexist — the voice model sees all sessions across all backends in session_list and can route handoff to a specific one by name.

Host Bootstrap

The Live Host installer is built in. On macOS, qwen-live init checks if the Host is installed and offers to download and install it (sha256 + codesign + team identifier verification). The daemon also exposes HTTP endpoints behind its Bearer token:

bash
TOKEN=$(jq -r .token ~/.qwen/live/daemon.json)
PORT=$(jq -r .url ~/.qwen/live/daemon.json | sed 's/.*://')
curl -H "authorization: Bearer $TOKEN" "http://127.0.0.1:$PORT/live/setup"

Protocol v7: Playback Receipts

The daemon speaks Live Host protocol v7, which adds playback receipts: the Host app sends host.playback_started and host.playback_completed messages when audio actually starts and finishes playing. The injector uses these real signals instead of estimating playback duration from byte counts.

A v6 Host still connects (the daemon falls back to a simpler playback model without byte estimation), but v7 is required for the full "dual-barrier delivery confirmation" described in the roadmap.

Status

Incubating inside the qwen-code monorepo, tracking M1–M5 of the Live split roadmap (issue #10118):

  • M1+M2 (merged): daemon, host stack, 7 tools, injector, permissions, steering, JSONL logs, Host installer
  • M4 (merged): AcpAdaptor, multi-backend routing, capability gating
  • M5 (this PR): protocol v7 playback receipts, qwen-live init wizard
  • M3 (blocked): session registry + cross-session messaging — depends on upstream #9576
  • Built-in Live module retirement: deferred until the standalone daemon is stable in production