@broch/cli
v1.26.0
Published
CLI client for Broch SSH tunnel server
Maintainers
Readme
Broch CLI
Command-line client for a Broch SSH tunnel server — expose local services over secure, authenticated tunnels.
Install
npm install -g @broch/cliThis installs the broch command on your PATH.
Point it at a server
The CLI does not ship with a built-in server URL — you have to tell it which Broch server to talk to:
broch config set --server https://trial.broch.iohttps://trial.broch.io is the hosted trial server. For most real use you'll point the CLI at your own self-hosted Broch server instead — there is no single "production" Broch server; each organization runs its own. For example:
broch config set --server https://broch.your-company.comYou can also override the server per-invocation with the BROCH_SERVER_URL environment variable. The setting persists in your local CLI config once set.
Authenticate
broch auth loginUse it
broch share my-app --target http://localhost:3000 # expose a local service over a tunnel
broch share my-app --target http://localhost:3000 --inspect # also capture requests for replay via a local inspector UI
broch status # show current server / auth stateWhile the tunnel is up, every inbound request is printed in a dim one-liner so you can see traffic land in real time:
my-app ← GET → 200 / (5ms)
my-app ← POST → 201 /api/users (12ms)Replayed requests appear with a ↳ arrow so they're easy to distinguish from live traffic.
Inspector
Without --inspect, broch share proxies traffic straight through and only the per-request log line above is retained. Pass --inspect and Broch also:
- buffers the last 50 requests + responses for the tunnel in memory (bodies truncated to 64 KB, kept until the buffer overflows or the process exits);
- starts a small local HTTP server bound to
127.0.0.1(default port 4040, falling through to 4041–4049 if 4040 is in use); and - prints the inspector URL alongside the tunnel URL on startup.
Open the inspector URL in your browser to see captured requests, expand details, and click "Replay" to fire any request again at your local target. Capture is memory-only — nothing is written to disk and nothing leaves your machine.
Run broch --help for the full command list.
Releases
Broch publishes the current release. Older versions are purged. Always run the latest.
Documentation
See broch.io/docs for the full Broch documentation, including how to run your own self-hosted server.
