mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
feat(tests): add CLI API response format tests and output format detection
This commit is contained in:
@@ -386,8 +386,14 @@ export function buildCommand(params: {
|
||||
fullCommand: `${command} ${args.join(' ')}${useStdin ? ' (stdin)' : ''}`,
|
||||
});
|
||||
|
||||
// Auto-detect output format: Codex uses --json flag for JSONL output
|
||||
const outputFormat = tool.toLowerCase() === 'codex' ? 'json-lines' : 'text';
|
||||
// Auto-detect output format: All CLI tools use JSON lines output
|
||||
// - Codex: --json
|
||||
// - Gemini: -o stream-json
|
||||
// - Qwen: -o stream-json
|
||||
// - Claude: --output-format stream-json
|
||||
// - OpenCode: --format json
|
||||
const jsonLineTools = ['codex', 'gemini', 'qwen', 'claude', 'opencode'];
|
||||
const outputFormat = jsonLineTools.includes(tool.toLowerCase()) ? 'json-lines' : 'text';
|
||||
|
||||
return { command, args, useStdin, outputFormat };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user