kagura open
Open the Kagura UI in your default browser. If a server is already
listening on the target port, the browser just opens; if nothing is
listening, open spawns a detached kagura run first, waits for the port
to come up, then opens the browser.
kagura open
# spawns `kagura run` if needed, waits up to 10s, then opens http://localhost:5253/
Use this when you want one command that "just shows me Kagura" without caring whether the server is already running.
Options
| Flag | Default | Notes |
|---|---|---|
--port <n> / -p <n> | 5253 | Port the server is on (or will be spawned on). |
How it works
- Probe
localhost:<port>with a 250 ms TCP connect. If something is already listening, skip to step 3. - Otherwise, spawn
kagura run --port <port>as a detached child process. The spawned server is the samekagurabinary on your$PATH— sokagura openonly works while the global tool is installed. - Poll the port every 200 ms for up to 10 seconds. If it never comes up,
exit with
server did not become ready on :<port> within 10s. - Open the URL using
open(macOS),xdg-open(Linux), orcmd /c start(Windows).
Exit codes
| Code | Meaning |
|---|---|
0 | Browser launched successfully. |
1 | Could not spawn kagura run (binary missing from PATH), the server never bound to the port, or the browser launcher failed. |
See also
kagura run— the underlying server command thatopenspawns for you.