Skip to main content

Crate terraphim_command_runtime

Crate terraphim_command_runtime 

Source
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.