aev-bridge
aev-bridge is the Aev bridge plugin crate from Trevor Knott / Knott Dynamics. It exposes a phone-friendly HTTP and Server-Sent Events interface that proxies to aev-web.
aev-bridge intentionally does not own PTYs or spawn terminal processes. aev-web owns terminal sessions, and aev-bridge focuses on safe LAN/mobile access and streaming output to browser clients.
Package
- Crate:
aev-bridge - Binary:
aev-bridge - Plugin ID:
aev-bridge - Plugin entrypoint:
aev_plugin_init - Protocol:
aev.plugin.v1 - Author: Trevor Knott
- Organization: Knott Dynamics
- Repository:
https://github.com/Tknott95/AevBridge
What It Does
- Binds a phone-accessible bridge server, default
0.0.0.0:8780. - Requires a bridge token for browser/API access.
- Proxies session creation, input, listing, and termination to
aev-web. - Streams terminal output over Server-Sent Events at
/api/sessions/{id}/events. - Accepts query-token auth for SSE because browser
EventSourcecannot set authorization headers. - Prints a LAN URL when it can detect one.
- Exposes an Aev plugin manifest at
/api/manifest.
Install
From crates.io:
From source:
Quick Start
Start aev-web first:
AEV_WEB_TOKEN=replace-with-a-secret
Start the bridge with the same upstream token and a phone token:
AEV_WEB_TOKEN=replace-with-a-secret AEV_BRIDGE_TOKEN=phone-secret
The bridge prints a URL like:
phone URL: http://192.168.1.50:8780/?token=phone-secret
Open that URL from a phone on the same LAN.
Configuration
| Setting | CLI | Environment | Default |
|---|---|---|---|
| Bridge bind address | --bind |
AEV_BRIDGE_BIND |
0.0.0.0:8780 |
| Bridge browser/API token | --token |
AEV_BRIDGE_TOKEN |
generated UUIDv7 token |
Upstream aev-web URL |
--upstream |
AEV_BRIDGE_UPSTREAM |
http://127.0.0.1:8765 |
Upstream aev-web token |
--upstream-token |
AEV_WEB_TOKEN |
required |
| Printed external URL | --public-url |
AEV_BRIDGE_PUBLIC_URL |
detected LAN URL |
| Output poll interval | --poll-ms |
AEV_BRIDGE_POLL_MS |
300 |
Use --bind 127.0.0.1:8780 if you only need local browser access and do not want LAN exposure.
HTTP API
Public health endpoint:
Authenticated fetch requests use Authorization: Bearer <bridge-token>.
Create a terminal session through the bridge:
Write terminal input:
Stream terminal output from JavaScript:
const events =
events.
Terminate a session:
API Routes
GET /healthreturns public bridge health.GET /api/manifestreturns theaev-bridgeplugin manifest.GET /api/upstream/healthchecks the configuredaev-webupstream.GET /api/sessionsproxies active session listing.POST /api/sessionsproxies session creation.GET /api/sessions/{id}proxies one session summary.GET /api/sessions/{id}/eventsstreams output as SSE.POST /api/sessions/{id}/inputproxies terminal input.DELETE /api/sessions/{id}terminates the upstream session.
Aev Registration
The current Aev plugin board validates descriptors and contracts. It does not load plugin code yet. Register the descriptor with:
/plugins add aev-bridge git https://github.com/Tknott95/AevBridge.git aev_plugin_init tool,bridge,mobile,http,sse,bearer-auth
/plugins validate all
See examples/plugins.json for an equivalent .aev/plugins.json entry.
Security
- Treat
AEV_BRIDGE_TOKENas phone/browser access to your bridge. - Treat
AEV_WEB_TOKENas upstream terminal access. - Keep both tokens out of committed files.
- LAN binding means other devices on the network can attempt to connect.
- Use a strong bridge token when binding to
0.0.0.0. - Prefer trusted local networks; this is not an internet-exposed gateway.
Development
Release Notes
See CHANGELOG.md.