naklios · aimax bridge

Run aimax in naklios.dev

Render your own aimax daemon inside the naklios.dev browser desktop — over your machine, nothing leaving your device. naklios is just a frontend; your daemon stays the source of truth.

YOUR MACHINE naklios.dev the renderer the bridge unix ↔ wss aimax --headless wss ~/.aimax/sock
The page runs on naklios.dev; everything it talks to runs on your machine.

Before you start

  1. 1

    Start aimax, headless

    Runs the daemon with just the IPC server, no TUI. It listens on a unix socket.

    aimax --headless
    # → IPC listening on ~/.aimax/sock
  2. 2

    Fetch & run the bridge

    One command grabs a single self-contained file and runs it. It exposes your unix socket as a WebSocket the browser can reach, over TLS with a real cert for local.naklios.dev. (Open the file first if you'd rather read it before running.)

    curl -fsSL https://bridge.naklios.dev -o nakli-bridge.mjs && node nakli-bridge.mjs
    # → nakli-local-bridge: wss://localhost:9130  ↔  ~/.aimax/sock  (TLS)
  3. 3

    Open the renderer & connect

    In Chrome, open the renderer and click Connect. The endpoint is pre-filled with wss://local.naklios.dev:9130 — which resolves to your own 127.0.0.1.

    open https://naklios.dev/prototypes/aimax-renderer/aimax
    # then click Connect
  4. 4

    Allow the local-network prompt

    Chrome asks permission for a public page to reach your machine. Click Allow — once.

    Expected — not a bug

    On the first connect, the status sits on “connecting…” and looks stuck. That's Chrome waiting on the “naklios.dev wants to access devices on your local network” prompt. Click Allow and it connects instantly. It's one-time, per browser.


What you get

Your live buffers as tabs, rendered natively (not a terminal in a tab). Click a tab to switch buffers. Type in the buffer and edits go to your daemon as (buffer-insert …). M-x runs your real eval — any Scheme, e.g. (buffer-names) or (buffer-switch "main.rs"). Nothing is edited in the browser; the daemon owns every buffer.

If it doesn't connect

Stuck on “connecting…”
The local-network prompt is waiting — click Allow. If you dismissed it, reload and Connect again.
“disconnected” immediately
Is aimax --headless running? Is node bridge.mjs running? The bridge needs both the socket and the browser.
TLS / cert error
Re-fetch the file (curl -fsSL https://bridge.naklios.dev -o nakli-bridge.mjs) — the cert is embedded in it; the cert renews every ~90 days.
Nothing renders but status is connected
Open wire ▾ (top right) to see the JSON-RPC traffic; check the bridge terminal for errors.

How it works

The renderer speaks aimax's own protocol — JSON-RPC 2.0 over your IPC socket (eval / get_state / subscribe + event notifications). It subscribes, pulls get_state for the buffer list and cursor, and eval (buffer-text) for content, re-pulling on each event. No invented wire.

The only trick is reaching a local daemon from a public https page. local.naklios.dev is a public DNS record that points at 127.0.0.1 — so on your machine it's your own loopback — and it has a real Let's Encrypt cert, so your browser trusts wss://local.naklios.dev with no cert install. The bridge just shims your unix socket to that wss endpoint.

About the shipped cert

The file includes the cert's private key. That's intentional: the cert only certifies 127.0.0.1, which never leaves your machine — there's no network path to intercept, so it can't MITM anything. Same pattern Plex and Discord use for their local helpers.

Where v0 stops

Honest limits, in case you want to close them from the daemon side:

prototypes/aimax-renderer github.com/NakliTechie/nakliOS