Skip to content

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Jan 28, 2026

A new CLI mode that allows you to directly invoke your server's fetch handler without starting an HTTP server.

This is useful for testing, debugging, and scripting and also specially for coding agents to test any server or route handler without actually running a server!

Works with any format also! Fetchable servers (H3, Hono, Elysia) or Node servers even (Express, Fastify).

Usage

srvx fetch [path]              # Fetch from default entry
srvx fetch /api/users          # Fetch a specific path
srvx fetch -X POST /api/users  # POST request
srvx fetch -H "Content-Type: application/json" /api  # With headers
srvx fetch -d '{"name":"foo"}' /api  # With request body
echo '{"data":1}' | srvx fetch -d @- /api  # Body from stdin
srvx fetch -d @payload.json /api  # Body from file
srvx fetch -v /api/users       # Verbose output (show headers)

Options

Flag Description
-X, --request <method> HTTP method (defaults to GET, or POST if body provided)
-H, --header <header> Add header (format: "Name: Value", repeatable)
-d, --data <data> Request body (use @- for stdin, @file for file)
-v, --verbose Show request and response headers

Highlights

  • No server required — directly calls your fetch handler for rapid testing
  • Streaming support — responses are streamed to stdout with proper encoding
  • curl-like interface — familiar flags for HTTP method, headers, and body
  • Stdin/file input — pipe data or read from files with @- and @filename syntax

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Warning

Rate limit exceeded

@pi0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 28, 2026

Open in StackBlitz

npm i https://pkg.pr.new/h3js/srvx@169

commit: 3e500ae

@pi0 pi0 merged commit bdf0dfd into main Jan 29, 2026
13 checks passed
@pi0 pi0 deleted the feat/cli-fetch branch January 29, 2026 00:18
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.

3 participants