mix athena.web (ExAthena v0.18.0)

Copy Markdown View Source

Starts the ExAthena web chat UI, bound to localhost by default.

mix athena.web
mix athena.web --port 4000
mix athena.web --lan

Opens a Phoenix LiveView chat interface backed by the same agent loop as mix athena.chat. Provider, model, and mode are configurable in the sidebar.

The UI is an arbitrary-command agent console (it runs bash/write tools in a browser-chosen directory), so by default it binds 127.0.0.1 and is only reachable from this machine. Exposing it more widely is an explicit opt-in (--lan or --host) and always requires a shared-secret token: one is generated (or taken from --token / the ATHENA_WEB_TOKEN env var) and printed as part of the startup URL — open that tokened URL once per browser.

For a full walkthrough — sidebar controls, session persistence, JSON provider setup, and screenshot tour — see the Web UI guide.

Flags

  • --port PORT — HTTP port (default 4000).
  • --lan — bind all interfaces (0.0.0.0) instead of loopback. Requires a token (auto-generated when none is supplied).
  • --host HOST — bind an explicit IP address (or localhost). Any non-loopback host requires a token, like --lan.
  • --token TOKEN — the shared secret gating access. Optional on loopback (default: no token), auto-generated on non-loopback binds. The ATHENA_WEB_TOKEN env var is used when the flag is absent.
  • --log — also write log output to log/phoenix_output.log (in addition to the terminal).

Summary

Functions

The ExAthena.Web.Endpoint config for the resolved settings.

Resolves argv (plus an env-var map, injectable for tests) into the runtime settings: bind ip/host, port, log flag, and the auth token (nil means open access, only allowed on loopback binds).

Functions

endpoint_config(settings)

The ExAthena.Web.Endpoint config for the resolved settings.

check_origin: :conn makes the websocket origin check require an exact scheme/host/port match against the connection — correct for a localhost UI on a configurable port, and still enforced on LAN binds.

settings!(argv, env \\ System.get_env())

@spec settings!([String.t()], %{optional(String.t()) => String.t()}) :: %{
  ip: :inet.ip_address(),
  host: String.t(),
  port: pos_integer(),
  token: String.t() | nil,
  log: boolean()
}

Resolves argv (plus an env-var map, injectable for tests) into the runtime settings: bind ip/host, port, log flag, and the auth token (nil means open access, only allowed on loopback binds).