Junction guide / Introduction
The REPL
bun run repl opens a shell on a running API, for trying a request without writing curl. It reads the live route list, keeps the last answer in $_ and can replay a session.
$ bun run repl # connects to localhost:3000
○ › health
○ › post /users {"name":"Alice","email":"a@b.com"}
● › auth my-token
● › set id = $_.id
● › get /users/$id
● › watch /health 2000
What else it can do
- Tab completes commands, live paths from
/metricsand$variablenames $_holds every response body, andset name = $_.fieldkeeps one part of itlast .data[0].emailpulls a field from the last answer, andinspect $_prints it wholewatch /health 2000polls an endpoint, and ctrl+c stops the watch without leaving the shell!3replays history entry 3health,metricsandserviceshit the built-in endpoints--port,--hostand--httpsaim it at another app:bun run tools/repl.ts --host staging.myapp.com --httpstutorialwalks four chapters in 18 steps against the real app, andtutorial listnames them
In depth: README § The REPL