pynenc.cli.monitor_cli

Module Contents

Functions

add_monitor_subparser

Add the monitor subparser to the main pynenc CLI.

start_monitor_command

Execute the monitor command, starting the web interface.

_check_monitor_dependencies

Check if required monitoring dependencies are installed.

_discover_apps_from_instance

Discover apps using an instantiated app’s state backend.

_discover_apps_from_config

Discover apps using the default state backend configuration.

get_all_available_apps

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 --app is provided: relies on config from environment variables or pyproject.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:

  1. Instance-based (--app provided): Uses the instantiated app’s state backend, which has the correct configuration (custom db path, etc.).

  2. Config-based (no --app): Creates a default Pynenc() instance and queries its state backend using configuration from environment variables or pyproject.toml.