pynenc.cli.monitor_cli¶
Module Contents¶
Functions¶
Add the monitor subparser to the main pynenc CLI. |
|
Execute the monitor command, starting the web interface. |
|
Check if required monitoring dependencies are installed. |
|
Discover apps using an instantiated app’s state backend. |
|
Discover apps using the default state backend configuration. |
|
Get all available apps in the current environment. |
API¶
- pynenc.cli.monitor_cli.add_monitor_subparser(subparsers: argparse._SubParsersAction) None[source]¶
Add the monitor subparser to the main pynenc CLI.
- pynenc.cli.monitor_cli.start_monitor_command(args: pynenc.cli.namespace.PynencCLINamespace) None[source]¶
Execute the monitor command, starting the web interface.
- pynenc.cli.monitor_cli._check_monitor_dependencies() bool[source]¶
Check if required monitoring dependencies are installed.
- pynenc.cli.monitor_cli._discover_apps_from_instance(app: pynenc.app.Pynenc) dict[str, pynenc.app.AppInfo][source]¶
Discover apps using an instantiated app’s state backend.
Best approach: the instance already has the correct config (e.g. custom sqlite_db_path set via the builder or config file).
- Parameters:
app (Pynenc) – The live application instance.
- Returns:
Dictionary mapping app_id to AppInfo.
- pynenc.cli.monitor_cli._discover_apps_from_config() dict[str, pynenc.app.AppInfo][source]¶
Discover apps using the default state backend configuration.
Fallback approach when no
--appis provided: relies on config from environment variables orpyproject.toml.- Returns:
Dictionary mapping app_id to AppInfo, or empty dict on failure.
- pynenc.cli.monitor_cli.get_all_available_apps(args: pynenc.cli.namespace.PynencCLINamespace) dict[str, pynenc.app.AppInfo][source]¶
Get all available apps in the current environment.
Two strategies:
Instance-based (
--appprovided): Uses the instantiated app’s state backend, which has the correct configuration (custom db path, etc.).Config-based (no
--app): Creates a defaultPynenc()instance and queries its state backend using configuration from environment variables orpyproject.toml.