@@ -30,7 +30,7 @@ hono serve
3030## Commands
3131
3232- ` docs [path] ` - Display Hono documentation
33- - ` search [ query] ` - Search Hono documentation
33+ - ` search < query> ` - Search Hono documentation
3434- ` request [file] ` - Send request to Hono app using ` app.request() `
3535- ` serve [entry] ` - Start server for Hono app
3636
@@ -60,10 +60,6 @@ hono docs /docs/api/context
6060# Display examples and tutorials
6161hono docs /examples/stytch-auth
6262hono docs /examples/basic
63-
64- # Path normalization (these are equivalent)
65- hono docs docs/concepts/stacks
66- hono docs /docs/concepts/stacks
6763```
6864
6965### ` search `
@@ -81,41 +77,55 @@ hono search <query> [options]
8177** Options:**
8278
8379- ` -l, --limit <number> ` - Number of results to show (default: 5, max: 20)
80+ - ` -p, --pretty ` - Display results in human-readable format (default: JSON output)
8481
8582** Examples:**
8683
8784``` bash
88- # Search for middleware documentation
85+ # Search for middleware documentation (JSON output by default)
8986hono search middleware
9087
88+ # Search with pretty formatting for human-readable output
89+ hono search middleware --pretty
90+
9191# Search with custom result limit
9292hono search " getting started" --limit 10
93-
94- # Search for specific topics
95- hono search jwt
96- hono search " cors middleware"
97- hono search routing
9893```
9994
100- ** Search Results :**
95+ ** Output Format :**
10196
102- Each result includes :
97+ By default, the command outputs JSON for easy integration with other tools :
10398
104- - ** Title** - The documentation page title with search terms highlighted
105- - ** Category** - Hierarchical path showing the document structure
106- - ** URL** - Direct link to the documentation page
107- - ** Command** - Corresponding ` hono docs ` command to view the content locally
99+ ``` json
100+ {
101+ "query" : " middleware" ,
102+ "total" : 5 ,
103+ "results" : [
104+ {
105+ "title" : " Middleware " ,
106+ "category" : " " ,
107+ "url" : " https://hono.dev/docs/guides/middleware#middleware" ,
108+ "path" : " /docs/guides/middleware"
109+ },
110+ {
111+ "title" : " Third-party Middleware - Hono" ,
112+ "category" : " Middleware" ,
113+ "url" : " https://hono.dev/docs/middleware/third-party#VPSidebarNav" ,
114+ "path" : " /docs/middleware/third-party"
115+ }
116+ ]
117+ }
118+ ```
108119
109- Example output :
120+ With the ` --pretty ` flag, results are displayed in a human-readable format :
110121
111122```
1121231. Middleware
113- Category: Middleware
114124 URL: https://hono.dev/docs/guides/middleware#middleware
115125 Command: hono docs /docs/guides/middleware
116126
1171272. Third-party Middleware - Hono
118- Category: Third-party Middleware - Hono > Middleware
128+ Category: Middleware
119129 URL: https://hono.dev/docs/middleware/third-party#VPSidebarNav
120130 Command: hono docs /docs/middleware/third-party
121131```
@@ -155,13 +165,10 @@ hono request -P /api/users -X POST -d '{"name":"Alice"}'
155165hono request -P /api src/your-app.ts
156166
157167# Request with custom headers
158- hono request -P /api/protected -H ' Authorization: Bearer token' -H ' User-Agent: MyApp' src/your-app.ts
159-
160- # PUT request with data and headers to specific file
161- hono request -P /api/users/1 -X PUT -d ' {"name":"Bob"}' -H ' Content-Type: application/json' src/your-app.ts
162-
163- # Complex example with multiple options
164- hono request -P /webhook -X POST -d ' {"event":"test"}' -H ' Content-Type: application/json' -H ' X-API-Key: secret' my-project/server.ts
168+ hono request -P /api/protected \
169+ -H ' Authorization: Bearer token' \
170+ -H ' User-Agent: MyApp' \
171+ src/your-app.ts
165172```
166173
167174** Response Format:**
@@ -204,7 +211,7 @@ hono serve [entry] [options]
204211hono serve
205212
206213# Start server on specific port
207- hono serve -p 8080 src/app.ts
214+ hono serve -p 3000 src/app.ts
208215
209216# Start server with specific entry file
210217hono serve src/app.ts
@@ -219,10 +226,9 @@ hono serve --use 'cors()' src/app.ts
219226hono serve --use ' cors()' --use ' logger()' src/app.ts
220227
221228# Start server with authentication and static file serving
222- hono serve --use ' basicAuth({username:"foo", password:"bar"})' --use " serveStatic({ root: './' })"
223-
224- # Combine all options
225- hono serve -p 8080 --show-routes --use ' cors()' --use ' logger()' src/app.ts
229+ hono serve \
230+ --use ' basicAuth({ username: "foo", password: "bar" })' \
231+ --use " serveStatic({ root: './' })"
226232```
227233
228234## Tips
@@ -234,9 +240,6 @@ The `search` command outputs JSON by default, making it easy to pipe results to
234240``` bash
235241# Search and view documentation in one command
236242hono search " middleware" | jq ' .results[0].path' | hono docs
237-
238- # Pretty output for human reading
239- hono search " middleware" --pretty
240243```
241244
242245## Authors
0 commit comments