An overview of cella's internal architecture and how it communicates with container runtimes.
cella is a single Go binary built on the Bubbletea framework (Elm architecture for terminals). It communicates with LXD and Docker through their respective Unix domain sockets β no daemon, no config files, no external dependencies.
βββββββββββββββββββββββββββββββββββββββββββββββββββ β cella TUI β β ββββββββββββ ββββββββββββ βββββββββββββββββ β β β Bubbleteaβ β Lipgloss β β cobra CLI β β β β (runtime)β β (styling)β β (entry point) β β β ββββββ¬ββββββ ββββββββββββ βββββββββββββββββ β β β β β ββββββ΄βββββββββββββββββββββββββββββββββββββββ β β β Runtime Interface (runtime.go) β β β β ListContainers() / Exec() / Stats() β β β ββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββ β β β β β β ββββββ΄βββββββββ βββββββββββ΄βββββββββββ β β β LXD Client β β Docker Client β β β β (unix sock) β β (unix sock) β β β βββββββββββββββ ββββββββββββββββββββββ β βββββββββββββββββββββββββββββββββββββββββββββββββββ
cella talks to LXD via its REST API over the Unix socket at /var/snap/lxd/common/lxd/unix.socket (snap) or /var/lib/lxd/unix.socket (deb).
GET /1.0/containers?recursion=2/sys/fs/cgroup (cpu.stat, memory.current, etc.)GET /1.0/events (WebSocket-upgraded SSE stream)POST /1.0/containers/{name}/exec with WebSocket for stdin/stdoutPATCH /1.0/containers/{name} for live config changesDocker uses the same interface but talks to /var/run/docker.sock:
GET /containers/jsonGET /containers/{id}/stats?stream=falsePOST /containers/{id}/exec + POST /exec/{id}/startGET /containers/{id}/logs?follow=truecella fetches from both runtimes concurrently using goroutines. The results are merged into a unified container list with a Runtime field ("lxd" or "docker") to distinguish them.
The entire TUI state lives in a single app struct (~300 fields). Bubbletea's update loop processes keyboard events and timer ticks, returning commands that trigger async operations (API calls, bpftrace output parsing, etc.).
All rendering happens in the View() method, which builds the entire screen as a string on every frame. Lipgloss handles styling, borders, and layout.