[PR #7139] [MERGED] docs(cli): document standard input for JSON request arguments #7670

Closed
opened 2026-11-03 13:39:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7139
Author: @viniciusdsandrade
Created: 10/25/2026
Status: ✅ Merged
Merged: 11/4/2026
Merged by: @morluto

Base: main ← Head: docs/7138-cli-json-stdin


📝 Commits (2)

  • 283adcf docs(cli): document standard input for JSON request arguments
  • 84c86f8 Merge remote-tracking branch 'upstream/main' into docs/7138-cli-json-stdin-merge

📊 Changes

1 file changed (+11 additions, -0 deletions)

View changed files

📝 docs/cli.md (+11 -0)

📄 Description

Summary

Fixes #7138. Since #7040 (for #5486), a CLI argument that accepts inline JSON or a JSON file path also reads the request from standard input when it is -. #5486 listed "The behavior is documented per command" in its acceptance criteria, but the merged change touched no documentation. This adds a short passage and an example to docs/cli.md, next to the existing request-file example.

Problem and expected behavior

Trigger: read docs/cli.md for how to pass a request to rea inspect-analysis-view, or any other command whose argument is described as inline JSON or a JSON file path.

Observed: the guide shows only a request file. Searching it for stdin or standard input matches only the signal note about stdin closing. Nothing says that - is accepted, that a piped request is limited to 8 MiB, or that a byte-order mark is refused.

Expected: the guide states the - form and its limits, so a generated request needs no temporary file.

Change and scope

  • docs/cli.md: 11 lines after the paragraph on evidence-file requests. They state that an argument accepting inline JSON or a JSON file path also accepts -, give one example, and state the limits: read once, one UTF-8 JSON document, no byte-order mark, at most 8 MiB, larger requests in a file.
  • Not included: changes to the shared argument descriptions (many commands reuse them, so that is a maintainer decision), code, and tests.

Documentation of existing behavior; no maintainer scope decision is needed.

Contract and boundary impact

  • Semantic owner and earliest changed stage: parseCliJsonInput in src/cliJsonInput.ts owns the behavior; this change only documents it.
  • Contribution scope fit and linked maintainer decision: not applicable; documentation only.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: not applicable.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Source-derived. The documented behavior was checked against:

  • src/cliJsonInput.ts:72 (- selects standard input), :127 and :141 (8 MiB).

  • src/application/Utf8JsonInput.ts:14, :83-84, :88 (invalid UTF-8 and a leading byte-order mark are refused).

  • src/application/JsonInputFile.ts:48-50 (a file larger than the native parse budget is accepted through the streaming parser).

  • Every CLI argument described as inline JSON or a JSON file path is read through parseCliJsonInput: src/cliBrowserScenarioCommands.ts, and in src/cli/: analysisViewCommands.ts, applicationCommands.ts, browserAdvancedCommands.ts, electronCommands.ts, managedCommands.ts, managedProjectGraphCommand.ts, nativeCallCommands.ts, nativeFunctionMatchingCommands.ts, sourceToBundleCommand.ts, wasmCommands.ts. The --source-paths-json option takes the same route (src/cli/javascriptApplicationAnalysis.ts).

  • The example reuses the command and request shape already shown in the same guide.

  • Tests added or updated: none; documentation only. tests/boundary/cli/cliJsonStdinCli.test.ts already pipes JSON to compare-wasm-interfaces - and environment-serve - through the public CLI.

  • Base reproduction or other evidence: see the list above.

  • User-visible CLI/MCP output (if applicable): not applicable.

  • Remaining proof gaps: the example command was not executed.

Validation performed

Current main (d48e472fa) is merged into the branch; the passage still sits between the evidence-file paragraph and the empty-path rule, and docs/cli.md on main still has no other mention of - for standard input.

  • npm run docs:check on the updated branch (Node 24.22.1, macOS arm64): 6 tasks passed.
  • The example command was not executed; the behavior was checked by reading the sources listed above.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: documentation only.

Author readiness

Human owner: @viniciusdsandrade

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7139 **Author:** [@viniciusdsandrade](https://github.com/viniciusdsandrade) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 11/4/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `docs/7138-cli-json-stdin` --- ### 📝 Commits (2) - [`283adcf`](https://github.com/morluto/rea/commit/283adcf9f27515a8f6d4fd76c05428bbbb9cdaea) docs(cli): document standard input for JSON request arguments - [`84c86f8`](https://github.com/morluto/rea/commit/84c86f86d185f6cde2334153a15eee3441b95e9c) Merge remote-tracking branch 'upstream/main' into docs/7138-cli-json-stdin-merge ### 📊 Changes **1 file changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/cli.md` (+11 -0) </details> ### 📄 Description ## Summary Fixes #7138. Since #7040 (for #5486), a CLI argument that accepts inline JSON or a JSON file path also reads the request from standard input when it is `-`. #5486 listed "The behavior is documented per command" in its acceptance criteria, but the merged change touched no documentation. This adds a short passage and an example to `docs/cli.md`, next to the existing request-file example. ## Problem and expected behavior Trigger: read `docs/cli.md` for how to pass a request to `rea inspect-analysis-view`, or any other command whose argument is described as inline JSON or a JSON file path. Observed: the guide shows only a request file. Searching it for `stdin` or `standard input` matches only the signal note about stdin closing. Nothing says that `-` is accepted, that a piped request is limited to 8 MiB, or that a byte-order mark is refused. Expected: the guide states the `-` form and its limits, so a generated request needs no temporary file. ## Change and scope - `docs/cli.md`: 11 lines after the paragraph on `evidence-file` requests. They state that an argument accepting inline JSON or a JSON file path also accepts `-`, give one example, and state the limits: read once, one UTF-8 JSON document, no byte-order mark, at most 8 MiB, larger requests in a file. - Not included: changes to the shared argument descriptions (many commands reuse them, so that is a maintainer decision), code, and tests. Documentation of existing behavior; no maintainer scope decision is needed. ## Contract and boundary impact - Semantic owner and earliest changed stage: `parseCliJsonInput` in `src/cliJsonInput.ts` owns the behavior; this change only documents it. - Contribution scope fit and linked maintainer decision: not applicable; documentation only. - CLI and MCP/tool-catalog contract: unchanged. - Provider, bridge, target-format, or platform compatibility: not applicable. - Evidence, artifact, provenance, or reconstruction contract: unchanged. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage Source-derived. The documented behavior was checked against: - `src/cliJsonInput.ts:72` (`-` selects standard input), `:127` and `:141` (8 MiB). - `src/application/Utf8JsonInput.ts:14`, `:83-84`, `:88` (invalid UTF-8 and a leading byte-order mark are refused). - `src/application/JsonInputFile.ts:48-50` (a file larger than the native parse budget is accepted through the streaming parser). - Every CLI argument described as inline JSON or a JSON file path is read through `parseCliJsonInput`: `src/cliBrowserScenarioCommands.ts`, and in `src/cli/`: `analysisViewCommands.ts`, `applicationCommands.ts`, `browserAdvancedCommands.ts`, `electronCommands.ts`, `managedCommands.ts`, `managedProjectGraphCommand.ts`, `nativeCallCommands.ts`, `nativeFunctionMatchingCommands.ts`, `sourceToBundleCommand.ts`, `wasmCommands.ts`. The `--source-paths-json` option takes the same route (`src/cli/javascriptApplicationAnalysis.ts`). - The example reuses the command and request shape already shown in the same guide. - Tests added or updated: none; documentation only. `tests/boundary/cli/cliJsonStdinCli.test.ts` already pipes JSON to `compare-wasm-interfaces -` and `environment-serve -` through the public CLI. - Base reproduction or other evidence: see the list above. - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: the example command was not executed. ## Validation performed Current `main` (`d48e472fa`) is merged into the branch; the passage still sits between the `evidence-file` paragraph and the empty-path rule, and `docs/cli.md` on `main` still has no other mention of `-` for standard input. - `npm run docs:check` on the updated branch (Node 24.22.1, macOS arm64): 6 tasks passed. - The example command was not executed; the behavior was checked by reading the sources listed above. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: documentation only. ## Author readiness Human owner: @viniciusdsandrade - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #7139] docs(cli): document standard input for JSON request arguments to [PR #7139] [MERGED] docs(cli): document standard input for JSON request arguments 2026-11-05 01:47:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7670
No description provided.