Qwen Code
Operating Qwen Code on workers — authentication types, the session id, several repositories, and add-on models through --auth-type openai.
Install
npm install -g @qwen-code/qwen-codeThe worker looks for qwen on the worker user's PATH.
Sign-in
Qwen Code has no default login in a headless run: configure an authentication type in its settings
(~/.qwen/settings.json) as the worker's user. Without one a run ends with "No auth type is selected", which
the worker reports as authentication required.
How it runs
qwen --yolo --output-format stream-json --session-id <uuid> [--model <model>] [--add-dir <dir>] <prompt>
- The prompt is positional;
-pis deprecated in Qwen Code. - The worker assigns each session its id.
- Projects with several repositories reach it: the other repositories are passed with
--add-dir.
Add-on models
For gateway sessions, and for OpenAI and OpenAI-compatible providers, the worker adds --auth-type openai and
sets OPENAI_API_KEY, OPENAI_BASE_URL and OPENAI_MODEL. On its own login it leaves --auth-type out, so
Qwen's settings decide. A complete task was run through the gateway against a test model.
Sessions
Resume is not claimed for Qwen Code: no resume command could be verified without an account. After a crash, recovery starts a fresh session from the checkpoint.
What was verified
Checked against Qwen Code 0.25.0 on 2026-10-06: its --help, and a real run without credentials through the
worker's session runtime. It also completed a task through the model gateway against a test model.