Skip to content

Add -o/--output flag to dictate command for text/json modes#192

Merged
alexkroman merged 1 commit into
mainfrom
claude/loving-turing-u29oou
Jun 16, 2026
Merged

Add -o/--output flag to dictate command for text/json modes#192
alexkroman merged 1 commit into
mainfrom
claude/loving-turing-u29oou

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Adds an -o/--output option to the assembly dictate command that allows users to explicitly choose between text (bare transcript, pipe-friendly) and json (one JSON object per utterance) output modes.

Summary

This change introduces output mode selection to the dictate command, bringing it into alignment with the stream and agent commands' output handling patterns. The new flag provides an explicit, discoverable way to select output format while maintaining backward compatibility (text remains the default).

Key Changes

  • New output_field parameter in DictateOptions to capture the -o/--output choice
  • Output mode resolution via resolve_output_modes() in run_dictate() to:
    • Fold -o json into json_mode (equivalent to --json)
    • Reject the contradictory --json + -o text combination with a UsageError
  • CLI integration in dictate/__init__.py:
    • Added choices.TextOrJson enum option
    • Wired the parameter through to DictateOptions
    • Updated help text and examples to show the new usage pattern
  • Test coverage for all three scenarios:
    • -o json enables NDJSON output without the --json flag
    • -o text emits bare transcript (no JSON wrapper)
    • --json + -o text raises UsageError as a usage conflict

Implementation Details

The implementation reuses the existing resolve_output_modes() utility from the streaming session module, ensuring consistent conflict detection and resolution across commands. The dictate command's text_mode half of the resolution is unused (plain text is already the non-JSON default in _emit()), but the infrastructure is in place for future enhancements.

https://claude.ai/code/session_01Knhve9pgqPSg2kQhxnV7Wn

dictate only exposed --json, so `assembly dictate -o text` errored even
though plain transcript text is already the non-JSON default. Add the
-o/--output {text,json} flag mirroring stream/agent: -o json folds into
json_mode (== --json), -o text is the explicit bare-transcript default,
and --json + -o text is rejected as a contradictory pair via the shared
resolve_output_modes helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Knhve9pgqPSg2kQhxnV7Wn
@alexkroman alexkroman enabled auto-merge June 16, 2026 21:14
@alexkroman alexkroman added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit 1b90c98 Jun 16, 2026
19 checks passed
@alexkroman alexkroman deleted the claude/loving-turing-u29oou branch June 16, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants