| 1 | import type { AgentDef } from '../types.js'; |
| 2 | |
| 3 | /** |
| 4 | * Qwen Code def (`qwen`, by Alibaba — QwenLM/qwen-code). |
| 5 | * |
| 6 | * Qwen Code is a fork of Gemini CLI, so the headless contract matches: piping |
| 7 | * a prompt on stdin to a non-TTY invocation runs it once and exits, default |
| 8 | * stdout is free-form text. We stay in plain mode and read the fenced |
| 9 | * ```html``` block from the output. |
| 10 | * |
| 11 | * bin is `qwen` (npm `@qwen-code/qwen-code`), NOT `gemini`. |
| 12 | */ |
| 13 | export const qwen: AgentDef = { |
| 14 | id: 'qwen', |
| 15 | name: 'Qwen Code', |
| 16 | bin: 'qwen', |
| 17 | versionArgs: ['--version'], |
| 18 | buildArgs(_prompt, _ctx) { |
| 19 | // Prompt via stdin; headless one-shot needs no extra args (same as Gemini CLI). |
| 20 | return []; |
| 21 | }, |
| 22 | streamFormat: 'plain', |
| 23 | promptViaStdin: true, |
| 24 | installUrl: 'https://github.com/QwenLM/qwen-code', |
| 25 | }; |
| 26 |