cli

CLI tool for declarative plugin management

source

main


def main(
    ctx:Context, cjm_config:Annotated=None, data_dir:Annotated=None, conda_prefix:Annotated=None,
    conda_type:Annotated=None
)->None:

CJM Plugin System CLI for managing isolated plugin environments.

Setup Runtime

The setup-runtime command downloads and installs micromamba for project-local mode. This is required before running install-all when using conda_type: micromamba in the configuration.


source

setup_runtime


def setup_runtime(
    force:bool=<typer.models.OptionInfo object at 0x7f9fbabacc20>
)->None:

Download and setup micromamba runtime for project-local mode.


source

run_cmd


def run_cmd(
    cmd:str, # Shell command to execute
    check:bool=True, # Whether to raise on non-zero exit
)->None:

Run a shell command and stream output.

Uses the platform’s default shell (no hardcoded /bin/bash).


source

install_all


def install_all(
    plugins_path:str=<typer.models.OptionInfo object at 0x7f9fbabad790>,
    force:bool=<typer.models.OptionInfo object at 0x7f9fbabae540>
)->None:

Install and register all plugins defined in plugins.yaml.

Setup Host Environment

The setup-host command prepares the host application’s Python environment by installing all unique interface libraries referenced in plugins.yaml. This is separate from install-all which sets up isolated plugin environments.


source

setup_host


def setup_host(
    plugins_path:str=<typer.models.OptionInfo object at 0x7f9fbabadac0>,
    yes:bool=<typer.models.OptionInfo object at 0x7f9fbabac8c0>
)->None:

Install interface libraries in the current Python environment.

Estimate Disk Space

The estimate-size command estimates the disk space required for plugin environments before installation. It uses conda’s dry-run feature for accurate conda package sizes and queries PyPI for pip package sizes.


source

estimate_size


def estimate_size(
    plugins_path:str=<typer.models.OptionInfo object at 0x7f9fbabae9c0>,
    plugin_name:Optional=<typer.models.OptionInfo object at 0x7f9fbabade20>,
    verbose:bool=<typer.models.OptionInfo object at 0x7f9fbabafcb0>
)->None:

Estimate disk space required for plugin environments.

List Plugins

The list command shows installed plugins by scanning manifest files in the configured manifests directory (defaults to ~/.cjm/manifests/). It can optionally cross-reference with a plugins.yaml file and check conda environment status.


source

list_plugins


def list_plugins(
    plugins_path:Optional=<typer.models.OptionInfo object at 0x7f9fbabaf500>,
    show_envs:bool=<typer.models.OptionInfo object at 0x7f9fbabafa40>
)->None:

List installed plugins from manifest directory.

Remove Plugin

The remove command removes a plugin’s manifest and optionally its conda environment. It can look up the environment name from the manifest or a config file.


source

remove_plugin


def remove_plugin(
    plugin_name:str=<typer.models.ArgumentInfo object at 0x7f9fba9dd1c0>,
    plugins_path:Optional=<typer.models.OptionInfo object at 0x7f9fbabac140>,
    keep_env:bool=<typer.models.OptionInfo object at 0x7f9fba9d58b0>,
    yes:bool=<typer.models.OptionInfo object at 0x7f9fba9d7230>
)->None:

Remove a plugin’s manifest and conda environment.