Components
Styrene has four operator-facing components and a shared crate ecosystem.
nex
Machine lifecycle tool. Manages packages, operator identity, and provisioning. Published on crates.io as nex-pkg.
| Status | Production |
| Binary | nex |
| Site | nex.styrene.io |
Capabilities
- Package management —
nex install,nex remove,nex adopt,nex migrateover nix-darwin, NixOS, and Homebrew - Identity —
nex identity init/show/ssh/git/link— create and manage StyreneIdentity - Provisioning —
nex init,nex forge,nex polymerize,nex profile,nex build-image - Health —
nex doctor,nex self-update
See nex + styrene for how it fits with the runtime tools.
styrene CLI
Unified binary for mesh operations. Combines the daemon, TUI, and one-shot CLI in a single tool with feature flags.
| Status | Alpha |
| Binary | styrene |
| Features | daemon (default), cli (default), tui (optional) |
Commands
| Command | Purpose |
|---|---|
styrene daemon | Run mesh daemon in foreground |
styrene status | Show mesh status |
styrene peers | List discovered peers |
styrene send | Send LXMF message |
styrene messages | Show conversation history |
styrene identity | Show daemon identity |
styrene announce | Trigger mesh announce |
styrene config | Show daemon configuration |
See Styrene CLI for full documentation.
styrened
Unified daemon, shared library, and TUI for the Styrene mesh. The TUI is bundled as a subpackage (styrened.tui), installed via the [tui] extra.
| Status | Alpha |
| Dependencies | RNS, LXMF, PyYAML, SQLAlchemy, msgpack |
| TUI Framework | Textual 8.0 |
| Tests | ~3,844+ (unit, TUI, mesh, bare-metal) |
| Theme | Imperial CRT (green phosphor terminal) |
Installation
pipx install styrene # Recommended (daemon + TUI, isolated env)
pip install styrened # Daemon + library only (no TUI, for edge devices)
nix run github:styrene-lab/styrened # Nix flake
Entry Points
| Command | Purpose |
|---|---|
styrene | Launch TUI (styrene --upgrade to self-update) |
styrened | Daemon CLI (headless) |
As Daemon (runs on edge devices)
- RPCServer — fleet management commands
- AutoReplyHandler — responds to NomadNet/MeshChat users
- LXMFService — messaging with optional propagation node mode
- Device Discovery + NodeStore — persistent mesh topology
- TerminalService — remote shell via PTY over RNS Link
- IPC Control Server — Unix socket for local CLI/TUI
- HTTP API — optional REST endpoints
As TUI (operator interface)
The TUI (styrened.tui) is a Textual-based terminal application using the Imperial CRT theme.
Screens:
- Dashboard — Fleet overview with mesh device table, activity feed
- Chat — Encrypted LXMF conversations with delivery tracking
- Device Detail — Mesh node info, actions (Message, Add Contact, Copy Hash)
- Settings — Tabbed: Identity, Network, Fleet, System
- Exploration — Non-Styrene RNS announces
- Upgrade — In-app self-update with live progress
- First-Run Wizard — Initial setup and daemon connection
Network Settings (7 panels):
- STYRENE COMMUNITY HUB — Single toggle (default ON), controls both transport peer and LXMF propagation destination
- TRANSPORT — Mode, transport toggle, announce interval
- PEERS — Dynamic add/remove of RNS transport peers
- PROPAGATION — LXMF propagation destination hash (auto-synced with community hub toggle, accepts custom 32-char hex)
- LOCAL DISCOVERY — AutoInterface toggle
- SERVER — Server interface (IP/port)
- BATMAN-ADV MESH — mesh_id, channel, gateway_mode
As Library
- RPC client/server implementations
- Wire protocol v2 encoding/decoding
- Message models and data structures
- Service lifecycle management (LXMFService, ConfigService, NodeStore)
- Device discovery and conversation services
Community Hub Integration
New installs default to the Styrene Community Hub (rns.styrene.io:4242):
- RNS transport peer for announce relay
- LXMF propagation destination for store-and-forward messaging
COMMUNITY_HUB_PROPAGATION_HASHconstant inmodels/config.py- OPERATOR profile defaults set this as
lxmf.propagation_destination
Theme: Imperial CRT
┌─ Imperial CRT Phosphor Palette ──────────────────────────┐
│ Bright: #39ff14 Active elements, highlights, success │
│ Medium: #32cd32 Standard text, borders │
│ Dim: #228b22 Secondary text, inactive elements │
│ Dark: #1a5c1a Subtle borders, separators │
│ Background: #0a0a0a │
└──────────────────────────────────────────────────────────┘
NixOS Integration
{
imports = [ ../common/styrened.nix ];
styrene.daemon.enable = true;
}
styrene-edge
Infrastructure-as-code and provisioning toolchain for the hardware fleet.
| Status | Production |
| Format | Nix configurations + Python (Forge) |
Active Devices
| Device | Arch | Boot | Media |
|---|---|---|---|
| MiniGMK (x86-generic) | x86_64 | UEFI 64 | USB installer |
| Q502L (x86-generic) | x86_64 | UEFI 64 | USB installer |
| T100TA | x86_64 | UEFI 32 | USB installer |
| Raspberry Pi 4 | aarch64 | U-Boot | Direct SD |
| Raspberry Pi Zero 2W | aarch64 | U-Boot | Direct SD |
| RG35XX H | aarch64 | U-Boot | Direct SD |
| R36S | aarch64 | U-Boot | Direct SD |
Usage
# Build SD card image for RPi 4 (fetches from Cachix)
nix build ./sbc#packages.aarch64-linux.rpi4-sd
# Launch Forge TUI for USB media preparation
just run
# Run polymerize.sh on target device after booting USB
sudo /iso/styrene/polymerize.sh
Structure
styrene-edge/
├── sbc/
│ ├── flake.nix # Nix flake for SD card images
│ ├── common/
│ │ ├── base.nix # styrene.base NixOS module (shared config)
│ │ ├── batman-mesh.nix # styrene.mesh BATMAN-adv module
│ │ ├── styrened.nix # styrene.daemon module
│ │ └── cosmic-desktop.nix # styrene.desktop COSMIC DE module
│ ├── rpi4/configuration.nix
│ ├── rpi-zero2w/configuration.nix
│ ├── x86-generic/
│ │ ├── configuration.nix
│ │ └── polymerize.sh # NixOS installer for UEFI x86
│ └── t100ta/
│ ├── configuration.nix
│ └── polymerize.sh # NixOS installer for 32-bit UEFI
├── firmware/ # Upstream firmware manifests
│ ├── sources.yaml # Pinned releases (version + sha256)
│ └── fetch.sh # Download and verify pinned artifacts
├── forge/ # Styrene Forge (media prep TUI)
│ ├── data/devices.yaml # Device catalog
│ └── services/
│ ├── media_writer.py # USB/SD media writer
│ └── bundle_builder.py # Config bundler
├── installs/ # Runbook tracking
├── keys/ # Builder SSH keys (public only in git)
├── mcu/ # Microcontrollers (RP2040, ESP32, nRF)
└── router/ # OpenWrt mesh routers
styrene-rs
Rust implementation of the Styrene platform. Canonical home for all styrene-* crates.
| Status | Alpha — daemon functional, TUI functional, CLI new |
| Repo | styrene-lab/styrene-rs |
Crate Inventory
Apps:
| Crate | Purpose |
|---|---|
styrene | Unified binary — daemon + TUI + CLI |
styrened | Daemon library (depended on by styrene) |
styrene-tui | TUI library (depended on by styrene with tui feature) |
Core libraries:
| Crate | Purpose | crates.io |
|---|---|---|
styrene-identity | Key hierarchy, signing, file encryption, discovery, key formatting | 0.2.0 |
styrene-rns | RNS protocol core — identity, destinations, links, transports | |
styrene-lxmf | LXMF messaging — router, propagation, stamps | |
styrene-mesh | Wire protocol envelope (msgpack framing) | |
styrene-ipc | IPC trait definitions and types | |
styrene-ipc-server | IPC server + wire protocol | |
styrene-services | Domain services (conversations, node store) | |
styrene-rbac | Role-based access control | |
styrene-secrets | Secrets management | 0.1.1 |
Ecosystem:
| Crate | Purpose |
|---|---|
styrene-forge | Forge API types (shared by scribe, codex, omegon) |
styrene-mqtt | MQTT 5.0 event fabric |
styrene-tunnel | PQC tunnel management (stub) |
styrene-amcp | CasparCG AMCP protocol client |
Relationship Diagram

See Also
- Architecture — System design overview
- Getting Started — Installation guide
- Hardware — Supported devices