feat(cli): add network response subcommand for body capture#882
Open
mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
Open
feat(cli): add network response subcommand for body capture#882mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Wire the existing `responsebody` handler to a new `network response <url-pattern>` CLI subcommand. Waits for a matching Network.responseReceived event and returns the body via Network.getResponseBody. Closes vercel-labs#111 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
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
Wire the existing
responsebodydaemon handler to a new CLI subcommand:network response <url-pattern>. This lets users capture response bodies from the command line, which was previously only available via batch/JSON mode.Closes #111
Evidence
handle_responsebodyalready implements CDP Network.getResponseBody but had no CLI commandImplementation
The daemon's
handle_responsebodyhandler was already complete - it subscribes toNetwork.responseReceivedevents, matches URLs, and callsNetwork.getResponseBody. This PR adds:network responsesubcommand inparse_network(commands.rs)--timeoutflag support (default 30s)Files changed
cli/src/commands.rs- addresponseto parse_network VALID list and parsercli/src/output.rs- response body output handler, help text updatesTest plan
cargo fmtpassescargo clippypassescargo testpasses (476 tests, 0 failures)agent-browser network response "/api/*"returns matching bodyThis contribution was developed with AI assistance (Claude Code).