Skip to content

feat: default core surfaces to json output - #92

Merged
kyaukyuai merged 1 commit into
mainfrom
codex/kya-310-json-default-v3
Apr 3, 2026
Merged

kyaukyuai merged 1 commit into
mainfrom
codex/kya-310-json-default-v3

Conversation

@kyaukyuai

@kyaukyuai kyaukyuai commented Apr 3, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --text flag to multiple commands for explicit human-readable terminal output (capabilities, cycle, document, issue, notification, project, resolve, webhook).
  • Documentation

    • Updated command documentation and examples to clarify JSON as the default machine-readable output format for agent-facing commands.
    • Refined --json flag descriptions across all commands to indicate "force machine-readable JSON output."
    • Updated usage guides to recommend --text for terminal-oriented inspection and debugging.

@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR updates the CLI to make machine-readable JSON the default output mode for agent-facing commands while adding an explicit --text option for human-readable terminal output. A centralized output-mode resolution utility is introduced to manage flag interpretation across commands, and documentation and tests are updated accordingly.

Changes

Cohort / File(s) Summary
Output Mode Resolution Logic
src/utils/output_mode.ts
New utility module centralizing output-mode selection. Defines default-JSON command paths, provides resolveJsonOutputMode() to determine effective output mode from --json/--text flags with validation, and rawArgsRequestJson() to detect JSON intent from raw arguments.
Capabilities Command
src/commands/capabilities.ts
Added --text option, updated --json description to clarify forced JSON output, introduced resolveJsonOutputMode() call to derive effective output mode, and updated validation/examples to reflect JSON as default with --text for human-readable output.
Cycle Commands
src/commands/cycle/cycle-current.ts
Added --text option, updated --json semantics, integrated resolveJsonOutputMode() to control spinner and output format selection based on resolved mode.
Document Commands
src/commands/document/document-list.ts
Added --text option with resolveJsonOutputMode() integration for output mode resolution; updated examples to show terminal output via --text.
Issue Commands
src/commands/issue/issue-*.ts
Updated all issue commands (create, list, update, view) to add --text option, reword --json descriptions, integrate resolveJsonOutputMode() for output selection, and adjust validation/examples accordingly.
Notification Commands
src/commands/notification/notification-list.ts
Added --text option, clarified --json as forced output, integrated resolveJsonOutputMode() for spinner/output control, and added examples demonstrating both modes.
Project Commands
src/commands/project/project-view.ts
Added --text option with resolveJsonOutputMode() integration; updated examples to show text output option.
Resolve Commands
src/commands/resolve/resolve-*.ts
src/commands/resolve/resolve-common.ts
Updated all resolve subcommands and common handler to accept both --json and --text options. resolve-common.ts signature changed to accept command path and options object, using resolveJsonOutputMode() to derive output mode.
Webhook Commands
src/commands/webhook/webhook-view.ts
Added --text option with resolveJsonOutputMode() integration for output mode control.
JSON Output Utilities
src/utils/json_output.ts
Updated error handling to use rawArgsRequestJson() from new output_mode module instead of local JSON-flag detection logic.
Documentation - Guides
README.md, docs/agent-first.md, docs/json-contracts.md
Updated command examples to remove --json from linear capabilities invocations, adjusted wording to reflect JSON as agent-facing default, and clarified --text usage for human-oriented output.
Documentation - Skill References
skills/linear-cli/SKILL.md, skills/linear-cli/SKILL.template.md
Updated recommended command sequences to show linear capabilities without --json while noting --compat v2 is optional; adjusted guidance for state reading to reference default-JSON surfaces.
Documentation - Command References
skills/linear-cli/references/*.md
Systematically updated CLI help text across command reference pages: changed --json descriptions to "Force machine-readable JSON output," added --text option documentation, removed --json from examples, and added text-output examples.
Test Cases - Snapshot Updates
test/commands/**/*.test.ts
Updated snapshot test invocations to pass --text flag for non-JSON output scenarios and removed explicit --json where JSON is now default; adjusted expected args across capabilities, cycle, document, issue, notification, project, and webhook command tests.
Test Cases - Contract/Doc Drift
test/contracts/contract-docs-drift.test.ts, test/skills/linear-cli/generate-docs.test.ts
Updated doc-extraction markers and runtime command assertions to match new conventions: linear capabilities instead of linear capabilities --json, and adjusted expected text in generated documentation tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

Poem

🐰 JSON flows by default, dear friend,
No --json flags needed to spend,
Add --text for eyes,
One mode will suffice,
Output modes resolved, let's ascend! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: default core surfaces to json output' accurately summarizes the main change: making JSON the default output mode for core CLI surfaces while adding explicit --text flags for human-readable output.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/kya-310-json-default-v3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kyaukyuai
kyaukyuai merged commit 494ac91 into main Apr 3, 2026
14 checks passed
@kyaukyuai
kyaukyuai deleted the codex/kya-310-json-default-v3 branch April 3, 2026 14:20
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.

1 participant