docs: document projection order for --results-only and --select - #1007
docs: document projection order for --results-only and --select#1007postoso wants to merge 1 commit into
Conversation
The two global flags are documented separately, so nothing states that --results-only is applied first, or how to project one field from every element of a list response. Adds a short paragraph to the two prose locations that describe these flags.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 20, 2026, 5:48 AM ET / 09:48 UTC. ClawSweeper reviewWhat this changesThis PR adds matching automation and agent-skill documentation explaining that Merge readinessKeep open: the documentation-only patch accurately describes the current JSON transformation order and path semantics, with no correctness finding. Likely related people: Peter Steinberger (current-source and frequent output-format contributor, medium confidence) and Yannick (recent adjacent output-format contributor, medium confidence). Priority: P3 Review scores
Verification
How this fits togetherGlobal CLI output flags configure JSON transformation after a Google API command returns its response. The formatter unwraps a command’s primary result when requested, projects selected paths, and writes parseable JSON to stdout. flowchart LR
A[CLI global flags] --> B[JSON transform settings]
B --> C[Output formatter]
C --> D[Unwrap primary result]
D --> E[Project selected JSON paths]
E --> F[Parseable JSON stdout]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Merge the narrowly scoped clarification in both maintained output-contract documents so automation users can choose paths relative to the unwrapped list element. Do we have a high-confidence way to reproduce the issue? Not applicable: this is documentation for an existing contract, independently verified by current source and its focused formatter test. Is this the best way to solve the issue? Yes: keeping the clarification in the hand-maintained automation guide and bundled agent skill documents the existing behavior without triggering generated command-reference churn. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eb85a99366eb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Scope
Documents the existing interaction between
--results-onlyand--select. No behavior change.The two global flags are documented separately today, so nothing states that
--results-onlyis applied first, or how to project one field from every element of a list response. Reaching for the envelope path--select items.idreturns{}, which is consistent with the best-effort projection contract but is not discoverable from the flag help.Adds a short paragraph to the two places that describe these flags in prose:
docs/automation.md, next to the existing--fieldsalias note.agents/skills/gog/SKILL.md, sameContent:
This follows #816, which documented the
--fieldsalias in the same two files after #814. #816 also touchedREADME.md, but the global-flags list it edited is no longer in the README, and the current "Automate safely" section defers todocs/automation.mdfor output contracts, so I left the README alone.Why not a help-string change
--selectand--results-onlyhelp text lives ininternal/cmd/root.go, and editing either regenerates 719 of the 720 pages underdocs/commands/. That seemed like the wrong trade for a clarification, so this stays in the hand-maintained prose. Happy to move it if you would rather it live in the flag help.Testing
make docs-checkandmake agent-skills-checkv0.37.0and a source build ofmainateb85a993, usinggog api listagainst the public Discovery directory:--select 'items.name'{}--select 'items.0.name'{"items.0.name": "..."}--results-only --select 'name'{"name": ...}per item--select 'kind,nope'{"kind": "..."}, unmatched path omittedUser-facing changes
Documentation only. No new flags, no behavior change.