Skip to content

feat(runtime): add --dry-run to print resolved request JSON#85

Merged
samzong merged 1 commit into
mainfrom
feat/resolved-request-dry-run
Jul 1, 2026
Merged

feat(runtime): add --dry-run to print resolved request JSON#85
samzong merged 1 commit into
mainfrom
feat/resolved-request-dry-run

Conversation

@samzong

@samzong samzong commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

What's changed?

  • Add --dry-run to generated commands: prints resolved request JSON (method, URL, redacted headers/body, auth, output hints) without sending HTTP traffic.
  • Skip OAuth token refresh during dry-run so inspection does not trigger side effects.
  • Extract resolveRequest / newRequest in the HTTP client so dry-run and live requests share the same request-building path.
  • Extend debug redaction to mask envVars[].value while preserving keys.
  • Document the flag in README and docs/cli-usage.md.

Why

Agents and operators need to confirm the resolved URL, headers, and body before executing API commands. --dry-run exposes that contract as machine-readable JSON with secrets redacted, matching the existing debug redaction rules.

Verification

go test ./pkg/runtime/... -count=1

All runtime tests pass, including TestBuild_DryRunPrintsResolvedRequestWithoutSending which asserts no HTTP request is sent and output is correctly redacted.

Add a --dry-run flag to generated commands that prints the resolved HTTP
request (method, URL, redacted headers/body, auth, output hints) without
sending it. Skip auth refresh during dry-run. Extract resolveRequest for
shared request building between DoRawFull and dry-run output.

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong samzong merged commit aa96be6 into main Jul 1, 2026
3 checks passed
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