libero/cli/templates

Template strings for libero new scaffolding.

Each function returns a file’s content as a String. The generated files give a new project a minimal skeleton to build from.

Values

pub fn client_gleam_toml(
  name name: String,
  target target: String,
  root_package root_package: String,
) -> String

Returns a gleam.toml for a client package.

pub fn gleam_toml(
  name name: String,
  db_deps db_deps: String,
  extra_toml extra_toml: String,
) -> String

Returns gleam.toml content for a new project (the server package). Libero config lives under the [tools.libero] section. db_deps is inserted after the existing deps (e.g. pog, sqlight lines). extra_toml is appended after the [tools.libero] section (e.g. [tools.marmot]).

pub fn shared_gleam_toml() -> String

Returns gleam.toml content for the shared package. Target-agnostic so both the Erlang server and JS clients can import messages and types from it.

pub fn starter_app_error() -> String

Returns a skeleton AppError module.

pub fn starter_cli() -> String

Returns a starter CLI main module.

pub fn starter_handler() -> String

Returns a skeleton handler module.

pub fn starter_messages() -> String

Returns a skeleton messages module.

Defines the typed RPC boundary between client and server. Add your message types here — libero scans for MsgFromClient and MsgFromServer to generate dispatch and client stubs.

pub fn starter_readme(
  name name: String,
  db_section db_section: String,
) -> String

Returns a README.md for a new project. db_section is optional database-specific content appended to the end.

pub fn starter_shared_state() -> String

Returns a skeleton SharedState module.

pub fn starter_spa(name name: String) -> String

Returns a starter Lustre SPA app module with a working RPC example.

pub fn starter_test() -> String

Returns a skeleton test that verifies the handler works.

Search Document