Hi, everyone. I'm Kanon. I'm the only contributor of Hono CLI excluding Code Owners(@yusukebe and @usualoma), when write this article.
This is first article of Hono Advent Calendar 2025. Tommorow's article will be written by @__syumai. Look forward to it!!
By the way, Do you know Hono CLI? Today, I'll introduce about Hono CLI and feature of watch option of request command of Hono CLI and implemention.
You can use watch option of request command of Hono CLI in v0.1.1. This is exciteing feature and implemention.
What's Hono CLI ?
It's annouced at Hono Conference 2025. Author of Hono, @yusukebe said
Hono CLI is a CLI for Humans and AI who use Hono.
Hono CLI will give you the hono command. For Humans, you can use sub-commands specialized for Hono for simple usages. For AI, providing sub-commands to build your Hono application efficiently with AI coding.
For example, setting CLAUDE.md or similar configuration, You can make works Coding Agent followed it.
Hono Development
Use the
honoCLI for efficient development. View all commands withhono --help.Core Commands
hono docs [path]- Browse Hono documentationhono search <query>- Search documentationhono request [file]- Test app requests without starting a serverQuick Examples
# Search for topics hono search middleware hono search "getting started" # View documentation hono docs /docs/api/context hono docs /docs/guides/middleware # Test your app hono request -P /api/users src/index.ts hono request -P /api/users -X POST -d '{"name":"Alice"}' src/index.tsWorkflow
- Search documentation:
hono search <query>- Read relevant docs:
hono docs [path]- Test implementation:
hono request [file]
By the way, Hono Conference was the best conference which I attended at 2025. If you want to know about Hono Conference, please refer this article.(It's japanese, though.)
What's request command ?
Using request command, you can send HTTP requests to your Hono application using the built-in app.request() method.
Usage: hono request [options] [file] Send request to Hono app using app.request() Arguments: file Path to the Hono app file Options: -P, --path <path> Request path (default: "/") -X, --method <method> HTTP method (default: "GET") -d, --data <data> Request body data -w, --watch Watch for changes and resend request (default: false) -H, --header <header> Custom headers (default: []) -h, --help display help for command
For example,
# send GET request to '/'
hono request
# response
{
"status": 200,
"body": "{\"message\":\"Hello World\"}",
"headers": {
"content-type": "application/json",
"x-custom-header": "value"
}
}
What's watch option ?
As explained earlier, You can send HTTP requests by using request command. However, it's only once. If you send HTTP request and change code base later, you have to re-type hono request. it's a little hassle.
watch option solves this issue.
In this PR, @usualoma implements watch option and attached a movie. You can watch the real action.
How does new request command rerun it?
1. changed to esbuild.build() to esbuild.context()
By changing this, retain build status and prepare to monitor file changes.

2. context.watch()
When calls .watch() for made context, esbuild starts to monitoring to entory point and dependencies file.

3. Dynamic import of Application
In the onEnd callback, dynamically import rebuilded latest application. Then, be generated instance of new application reflected changes.

4. buildAndImportApp Function
buildAndImportApp is defined as Async Generator Function. this means asyncronusly yield Hono app instance several time.

In the do...while loop, await resolving appPromise, provide to command to resolved Hono App instance to caller of request.
After yield, re-call preparePromise() and prepare to appPromise for next file change.
If watch option is true, this loop endless continue to execution and provide new Hono App instance every changing file.

This is why, You don't have to re-type hono request if you use watch option. Great!!🎉
Conclusion
Knowing this implementation pattern, It's useful for example, in case making fire event by triggered file change. Also, thiswatch option itself is very useful too.
I hope to continue contributing to Hono CLI in whatever small way I can.
This was my first english tech article. How about this? Please feedback to me.