···42424343```bash
4444# Terminal 1 — start the server (no env vars needed)
4545-cargo run -p ein-server
4545+cargo run --bin ein-server
46464747# Terminal 2 — start the TUI (connects to localhost:50051 by default)
4848-cargo run -p ein-tui
4848+cargo run --bin ein-tui
49495050# Optional: connect to a non-default server address
5151cargo run -p ein-tui -- http://my-server:50051
+4-4
README.md
···128128Start the server in one terminal:
129129130130```bash
131131-cargo run -p ein-server
131131+cargo run --bin ein-server
132132```
133133134134Start the TUI client in another:
135135136136```bash
137137-cargo run -p ein-tui
137137+cargo run --bin ein-tui
138138```
139139140140The TUI connects to `localhost:50051` by default. To connect to a different address:
141141142142```bash
143143-cargo run -p ein-tui -- http://my-server:50051
143143+cargo run --bin ein-tui -- http://my-server:50051
144144```
145145146146To enable debug logging to `~/.ein/tui.log`:
147147148148```bash
149149-cargo run -p ein-tui -- --debug
149149+cargo run --bin ein-tui -- --debug
150150```
151151152152On first connection a **session picker** modal appears. Use `↑`/`↓` to navigate, `Enter` to select:
···11-// SPDX-License-Identifier: Apache-2.0
22-// Copyright 2026 Mason Stallmo
33-44-//! Ein server binary.
55-//!
66-//! Starts a gRPC server that exposes the `Agent` service defined in
77-//! `ein-proto`. Clients (e.g. `ein-tui`) open a bidirectional streaming
88-//! session, stream user prompts in, and receive a sequence of `AgentEvent`
99-//! messages back as the agent thinks, invokes tools, and produces output.
1010-//!
1111-//! # Configuration
1212-//!
1313-//! | Variable | Description | Default |
1414-//! |----------|-------------------------------------|---------|
1515-//! | `--port` | TCP port the gRPC server listens on | `50051` |
1616-//!
1717-//! API credentials (`api_key`, `base_url`) are supplied by the client via
1818-//! `SessionConfig` at connection time, read from `~/.ein/config.json`.
1919-//!
2020-//! # Plugin loading
2121-//!
2222-//! In debug builds, WASM plugins are loaded from `./target/wasm32-wasip2/debug/`.
2323-//! In release builds tool plugins are loaded from `~/.ein/plugins/tools/` and
2424-//! model client plugins from `~/.ein/plugins/model_clients/`.
2525-//! Run `./scripts/build_install_plugins.sh` to compile and install them.
2626-2727-use clap::Parser;
2828-2929-#[derive(Parser)]
3030-#[command(author, version, about)]
3131-struct Args {
3232- /// TCP port for the gRPC server to listen on.
3333- #[arg(long, default_value = "50051")]
3434- port: u16,
3535-}
3636-3737-#[tokio::main]
3838-async fn main() -> anyhow::Result<()> {
3939- ein_server::run(Args::parse().port).await
4040-}