Skip to content

krites launch

What krites launch does

Open the studio in your browser, starting one if none is running. It is the zero-terminal entry point the packaged macOS app uses when you double-click Krites.

Usage

krites launch

launch takes no flags of its own — only the global flags on every command. It always starts the studio on an ephemeral port; to pin a port, run krites studio --port directly.

Reopen, or start — how it decides

  1. Read the singleton lock at <user config dir>/krites/studio.lock (on macOS, ~/Library/Application Support/krites/studio.lock).
  2. If a live process holds it and answers GET /api/v1/version on the port recorded there, open the browser on that port and exit. Nothing is started.
  3. Otherwise spawn a detached krites studio in its own session, poll the lock and the probe until one answers, then open the browser.

That is why clicking Krites again reopens the studio you already have rather than starting a second one.

It waits 20 seconds, then gives up

The readiness poll runs every 200 ms for a maximum of 20 seconds, and each liveness probe is bounded at 750 ms. If the spawned studio has not bound its port, written it to the lock and answered within 20 seconds, launch returns an error — the studio may still come up afterwards, in which case running launch again reopens it.

The studio outlives the launcher

The spawned studio is deliberately detached: it runs in its own session, is released by the launcher, and is not bound to the launcher's lifetime. Cancelling krites launch, or the launcher process exiting, does not stop the studio. Use Shutdown krites in the studio settings to stop it.

Where a detached studio's logs go

studio.log, beside the lock file — <user config dir>/krites/studio.log, appended to. A detached studio has no terminal, so this is the only place its output lands. If the log file cannot be opened, the studio still starts; it just runs without a log sink.

No token is handed over

launch opens the plain http://127.0.0.1:<port>/ URL. The studio's SPA shell sets the session cookie on first load, so there is no token in the URL, in the process table, or in the shell history. See the studio API reference.

launch is hidden from the MCP tool surface

An agent cannot start a studio or open a browser. See krites mcp.