This page was generated from the source of RoboHub. Edit the source, not this page.
Settings store
The values a person may change while an application runs, kept in the
application's own workspace. A module reads and writes a namespaced key rather
than a file beside itself, so every module an application includes shares one
store and two applications never share one.
How an application uses it
Add settings to deps and include it. It needs no host hooks and serves no
routes; the modules that have settings (logging, inventory, scheduler,
widgets) call it themselves, and their settings forms are shown on the
application's settings page (see appshell/index).
let currency: string = settings_get("inventory.currency", "RON")
settings_set("inventory.currency", "EUR")
let mine: string = settings_list("inventory.") // `key=value` lines
settings_get(key, fallback)— the stored value, orfallbackwhen the key
is not there.settings_set(key, value)— stores a value, replacing the key's line or
adding one.settings_list(prefix)— everykey=valueline whose key starts with
prefix, so a host can draw a generic editor for a module that has no form of
its own.
Where it is kept
<workspace>/data/settings.conf, one key=value per line. The workspace is the
one the supervisor gives the application (RHO_APP_WORKSPACE, or
ROBOHUB_APP_WORKSPACE); a program started by hand uses
~/.rho/apps/<app>. Values are plain text, and a value containing an equals
sign keeps it after the first one.
Each module keeps its keys under its own prefix: log.*, inventory.*,
scheduler.*, widgets.*. The keys each module reads are listed on its own
page.
Configuration that belongs to a build or deployment — ports, routes, commands,
database drivers — stays in module.yml. A provider's settings are not kept
here either: they are its bind: values, overridden by the application's
bind.conf. This store is for values a person may change at runtime.
Reference
Generated from the module's manifest and sources when this site was built.
Exports — what an application may call (provides.exports, imported as robohub.settings):
settings_getsettings_setsettings_list
Release history
[0.1.0] - 2026-11-08
First release. Adds the host-owned key-value settings store used by applications and their modules.
[0.1.1] - 2026-11-12
The store also follows RHO_APP_WORKSPACE, the name the keeper gives an application's workspace, so an application started with only that one keeps its settings to itself instead of sharing the fallback store.
[0.2.0] - 2026-11-12
The module publishes its interface: it is imported as robohub.settings, and exports settings_get, settings_set, settings_list. Everything else in it is its own, so an application that imports it cannot reach its helpers, and they never collide with the application's own names. Including it by name still works and is reported with the import to use instead.
[0.2.1] - 2026-11-12
The module builds on its own: it declares the runtime functions it calls and no longer needs the including application's ignore_u32.
[0.2.2] - 2026-11-14
Its data is kept where app_workspace() says (rho 0.8.0) — the application's workspace, else ~/.rho/apps/<app> — so two applications started by hand no longer share this module's records. Needs rho 0.8.0.