saturnin._scripts.completers

CLI command completers.

These functions are designed for use with Typer/Click arguments and options via the autocompletion parameter. They provide context-aware suggestions to enhance the command-line user experience.

Functions

saturnin._scripts.completers.get_first_line(text: str) str[source]

Returns the first non-empty line from the input string.

Parameters:

text (str)

Return type:

str

saturnin._scripts.completers.oid_completer(ctx, args, incomplete) list[source]

Click completer for OIDs.

Provides completion suggestions based on registered OID UUIDs and their full names from the oid_registry.

Returns:

A list of strings, where each string is either an OID’s UUID or its full name.

Return type:

list

saturnin._scripts.completers.service_completer(ctx, args, incomplete) list[source]

Click completer for Saturnin services.

Provides completion suggestions based on registered service UIDs and names from the service_registry.

Returns:

A list of strings, where each string is either a service’s UID or its name.

Return type:

list

saturnin._scripts.completers.application_completer(ctx, args, incomplete) list[source]

Click completer for Saturnin applications.

Provides completion suggestions based on registered application UIDs and names from the application_registry.

Returns:

A list of strings, where each string is either an application’s UID or its name.

Return type:

list

saturnin._scripts.completers.recipe_completer(ctx, args, incomplete) list[tuple[str, str]][source]

Click completer for Saturnin recipes.

Provides completion suggestions based on installed recipe names from the recipe_registry, along with their descriptions.

Returns:

A list of (value, help_text) tuples, where value is the recipe name and help_text is the first line of its description.

Return type:

list[tuple[str, str]]

saturnin._scripts.completers.path_completer(ctx, args, incomplete) list[source]

Click completer for filesystem Path values.

Provides completion suggestions by globbing for files and directories based on the incomplete path string. It navigates up to the nearest existing parent directory if the incomplete path itself doesn’t exist.

Returns:

A list of strings, where each string is a potential path completion.

Return type:

list