MCPcopy
hub / github.com/MiniMax-AI/cli / detectOutputFormat

Function detectOutputFormat

src/output/formatter.ts:6–14  ·  view source on GitHub ↗
(flagValue?: string)

Source from the content-addressed store, hash-verified

4export type OutputFormat = 'text' | 'json';
5
6export function detectOutputFormat(flagValue?: string): OutputFormat {
7 if (flagValue === 'json' || flagValue === 'text') {
8 return flagValue;
9 }
10 if (!process.stdout.isTTY) {
11 return 'json';
12 }
13 return 'text';
14}
15
16export function formatOutput(data: unknown, format: OutputFormat): string {
17 switch (format) {

Callers 15

runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected