Serve Shore TUIs over SSH
Find a file
2025-07-31 20:06:36 +01:00
examples example: update dependencies and add logging 2025-07-31 20:00:15 +01:00
src feat: add hardening options and fix state return in cli 2025-07-31 19:49:55 +01:00
test feat: initial commit 2025-07-10 17:37:27 +01:00
.gitignore examples: add base examples structure 2025-07-10 19:27:26 +01:00
flake.lock build: add flake.nix 2025-07-22 16:55:38 +01:00
flake.nix build: add flake.nix 2025-07-22 16:55:38 +01:00
gleam.toml v1.0.0 2025-07-31 20:06:36 +01:00
LICENSE docs(license): add MIT license 2025-07-10 19:57:17 +01:00
manifest.toml v1.0.0 2025-07-31 20:06:36 +01:00
README.md docs(README): update example with max_sessions 2025-07-31 20:01:58 +01:00

beach

Package Version Hex Docs

A library for serving a shore TUI over ssh.

Further documentation can be found at https://hexdocs.pm/beach.

Host Keys

Beach requires your provide ssh host keys for your application. You can create these by running the following command:

# this is only needed once
ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N ''

Example

gleam add beach@1
import beach
import shore

pub fn main() {
  let exit = process.new_subject()
  let spec =
    shore.spec(
      init:,
      update:,
      view:,
      exit:,
      keybinds: shore.default_keybinds(),
      redraw: shore.on_timer(16),
    )
  let config =
    beach.config(
      port: 2222,
      host_key_directory: ".",
      auth: beach.auth_anonymous(),
      on_connect: fn(_connection, _shore) { Nil },
      on_disconnect: fn(_connection, _shore) { Nil },
      max_sessions: Some(1000),
    )
  let assert Ok(_) = beach.start(spec, config)
  process.sleep_forever()
}

// see shore for application implementation
ssh localhost -p 2222