ersilia.cli package¶
Subpackages¶
- ersilia.cli.commands package
- Subpackages
- Submodules
- ersilia.cli.commands.catalog module
- ersilia.cli.commands.close module
- ersilia.cli.commands.delete module
- ersilia.cli.commands.example module
- ersilia.cli.commands.fetch module
- ersilia.cli.commands.info module
- ersilia.cli.commands.publish module
- ersilia.cli.commands.run module
- ersilia.cli.commands.serve module
- ersilia.cli.commands.test module
- ersilia.cli.commands.uninstall module
- Module contents
Submodules¶
ersilia.cli.cmd module¶
ersilia.cli.create_cli module¶
- ersilia.cli.create_cli.create_ersilia_cli()[source]¶
Creates and configures the Ersilia CLI.
This function initializes the Command class, checks if the user is a contributor, and dynamically imports and executes various CLI commands based on the user’s role.
- Returns:
ersilia_cli – The configured Ersilia CLI module.
- Return type:
module
ersilia.cli.echo module¶
ersilia.cli.messages module¶
- class ersilia.cli.messages.ModelNotFound(model)[source]¶
Bases:
objectA class to handle the scenario when a model is not found.
- model¶
The model object that was not found.
- Type:
object
- class ersilia.cli.messages.ModelNotInLocal(model_id)[source]¶
Bases:
objectA class to handle the scenario when a model is not found locally.
- model_id¶
The identifier of the model that was not found locally.
- Type:
str
- ersilia.cli.messages.no_model_served(fg='red', hint=None)[source]¶
Tell the user that no model is served in this terminal.
- Parameters:
fg (str, optional) – “red” when the command cannot continue, “yellow” when nothing needed to be done (e.g.
ersilia close).hint (str, optional) – What to do instead of serving a model, shown after the usual hint.
- ersilia.cli.messages.report_error(error)[source]¶
Print an error the standard way (message, then hint) and exit with code 1.
- Parameters:
error (Exception) – The error, typically an
ErsiliaError.
- ersilia.cli.messages.served_elsewhere_hint()[source]¶
Point to ERSILIA_SESSION when the model may be in another session.
Commands started through wrappers such as
conda run, make or CI steps each get a new session: a model served by one such command is stopped by the next (its session’s process has ended), or runs in a session that this command cannot see. Nothing is printed otherwise.