Expand description
Shared command-runtime helpers for Terraphim CLI front-ends.
Extracts the configuration and role-resolution logic that was duplicated
between terraphim_cli’s CliService and terraphim_agent’s TuiService
(ADR-003, Gitea #1910). Both front-ends now delegate this common surface
here, so the behaviour can no longer drift between the two binaries.
The helpers operate on a borrowed ConfigState (and Persistable for the
save path) rather than owning service state, so each front-end keeps its own
struct and simply forwards these calls.
Functions§
- find_
role_ by_ name_ or_ shortname - Find a role by exact name, then by shortname (both case-insensitive).
- get_
config - Snapshot the current configuration.
- get_
selected_ role - Return the currently selected role.
- list_
roles_ with_ info - List all configured roles with their optional shortnames.
- save_
config - Persist the current configuration to all configured backends.