Terminal User Interfaces over SSH for Phoenix applications.
Clinex brings LiveView-like development to the terminal, with ~T templates, flexbox layout via Taffy/Rustler, and efficient ANSI diff rendering.
- LiveView-compatible architecture: Same callbacks (
mount/3,handle_event/3,handle_info/2) ~Tsigil: Declarative TUI templates with components like<.box>,<.text>,<.input>- Flexbox layout: CSS-like positioning via Taffy (Rust NIF)
- Efficient rendering: Only changed content is re-rendered using ANSI escape sequences
- SSH transport: Secure terminal access with public key and password authentication
Add clinex to your dependencies in mix.exs:
def deps do
[
{:clinex, "~> 0.1.0"}
]
enddefmodule MyApp.DashboardTUI do
use Clinex.Live
def render(assigns) do
~T"""
<.box border="rounded" padding={1}>
<.text color="green">Status: {@status}</.text>
</.box>
"""
end
def mount(_params, _session, socket) do
{:ok, assign(socket, status: "online")}
end
endAdd to your supervision tree:
children = [
{Clinex.SSH.Daemon, port: 2222, router: MyApp.ClinexRouter}
]Connect via SSH:
ssh localhost -p 2222Documentation can be generated with ExDoc and published on HexDocs.
mix docs