Describe the problem
The deadline CLI has seven subcommands that accept an --output flag (job wait, job logs, bundle submit, bundle gui-submit, bundle run, auth status, config show). They all default to a human-readable format (verbose or text).
This is the right default for a human at a terminal, but the wrong default for the two largest non-human audiences:
- AI agents and scripts invoking the CLI to parse its output. They have to remember to pass
--output json on every call, or build a wrapper.
- Pipelines and redirection like
deadline job logs --job-id … > out.txt, where the human writer is no longer the reader.
The current situation also forces agent-oriented docs and tools to repeat --output json everywhere, which is boilerplate that the CLI should handle itself.
Proposed Solution
When --output is not specified, detect whether stdout is a TTY and default to json when it is not. Humans at a terminal keep today's human-readable output; agents, pipes, and CI get JSON automatically. Explicit --output values always win.
Prior art for this pattern:
Example Use Cases
Agent invocation becomes boilerplate-free.
Before:
deadline bundle run ./my_bundle --output json -q
deadline job logs --job-id "$JOB_ID" --output json
deadline job wait --job-id "$JOB_ID" --output json
After:
deadline bundle run ./my_bundle
deadline job logs --job-id "$JOB_ID"
deadline job wait --job-id "$JOB_ID"
Humans keep the readable output with no change. Running any of these commands in a terminal still prints the human format.
CI or container jobs without a TTY get JSON for free:
- name: Wait for job
run: deadline job wait --job-id ${{ steps.submit.outputs.job-id }}
Opt-out for edge cases. A script that wants human output despite being non-interactive can pass --output verbose; a human who wants JSON in a terminal can pass --output json.
Describe the problem
The
deadlineCLI has seven subcommands that accept an--outputflag (job wait,job logs,bundle submit,bundle gui-submit,bundle run,auth status,config show). They all default to a human-readable format (verboseortext).This is the right default for a human at a terminal, but the wrong default for the two largest non-human audiences:
--output jsonon every call, or build a wrapper.deadline job logs --job-id … > out.txt, where the human writer is no longer the reader.The current situation also forces agent-oriented docs and tools to repeat
--output jsoneverywhere, which is boilerplate that the CLI should handle itself.Proposed Solution
When
--outputis not specified, detect whether stdout is a TTY and default tojsonwhen it is not. Humans at a terminal keep today's human-readable output; agents, pipes, and CI get JSON automatically. Explicit--outputvalues always win.Prior art for this pattern:
cli_auto_prompt/ output configuration.kubectl getoutput formats.Example Use Cases
Agent invocation becomes boilerplate-free.
Before:
After:
Humans keep the readable output with no change. Running any of these commands in a terminal still prints the human format.
CI or container jobs without a TTY get JSON for free:
Opt-out for edge cases. A script that wants human output despite being non-interactive can pass --output verbose; a human who wants JSON in a terminal can pass --output json.