Web Browser

Open URLs in the client's default browser

A command can open a web page on the user’s machine. It’s how you hand off to anything that’s easier in a browser than a terminal: OAuth and SSO login, a billing page, a generated report.

@desc "Open your dashboard"
def dashboard do
  Terminalwire.Server.Context.browser_launch(context(), "https://example.com/dashboard")
end

In a handler, you already have the context:

def run(ctx) do
  Terminalwire.Server.Context.browser_launch(ctx, url)
end

Pair it with a Phoenix route to build a real login flow: open an authorize page, let the user sign in with whatever your web app already uses, and hand a token back to the waiting command. Authentication walks through it end to end.

Security

browser_launch only opens http and https URLs. Schemes like file: are refused, so a server can’t use the browser to reach into the workstation.