feat: add global --json flag and deprecate per-command --format json#204
Merged
Conversation
Introduce a global --json flag as the canonical way to request machine-readable output, and deprecate the per-command --format json (still honored, warns once on stderr). - Add JSON output to search, spaces, and find (previously unavailable) - Route existing --format json commands through a shared lib/output helper (info, children, versions, comments, attachments, property-*) - Reject --json on commands that don't support it with a clear error instead of silently emitting human-readable output - Fix comments emitting "No comments found." to stdout in JSON mode Refs #203
… fix Bumps transitive form-data to 4.0.6 (CRLF injection, GHSA-hmw2-7cc7-3qxx) and markdown-it to 14.2.0 (quadratic-complexity DoS, GHSA-6v5v-wf23-fmfq). Lockfile-only and non-breaking; clears the production npm audit enforced by the CI security job.
|
🎉 This PR is included in version 2.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--format jsonwas only supported on a subset of commands, and there was no consistent way to get machine-readable output for piping to tools likejq. This adds a global--jsonflag as the canonical mechanism and deprecates the per-command--format json(still honored, warns on stderr).What changed
--jsonflag — works uniformly across all read/query commands.search,spaces,findpreviously had no JSON option at all.--format jsoncommands migrated to a sharedlib/outputhelper:info,children,versions,comments,attachments,property-list/get/set. The deprecated--format jsonstill works and prints a one-time deprecation warning to stderr.--jsonto a command that doesn't support it (e.g.create,read) now errors with a clear message + exit 1, instead of silently emitting human-readable output.commentsno longer printsNo comments found.to stdout in JSON mode — it now emits a valid empty JSON object, keeping stdout parseable.Human-readable messages and warnings go to stderr, so stdout always stays valid JSON for
jq.Scope
This covers all read/query commands (the piping-to-
jquse case from #203). Adding--jsonoutput to mutation commands (createreturning id/url, etc.) is deferred to a follow-up; for now they fail loud on--json.Testing
npm test— 741 passing (newtests/json-output.test.jscovers--json, the--format jsondeprecation warning, clean empty output, and the fail-loud path).npm run lint— clean.Refs #203