nexusLIMS.cli.config#

CLI commands for dumping and loading NexusLIMS configuration.

Provides nexuslims config dump and nexuslims config load for exporting the current effective configuration to JSON and importing a previously dumped configuration back into a .env file. The JSON format uses a nested structure for NEMO harvesters and email config so that the file is both human-readable and unambiguous.

Usage#

.. code-block:: bash

# Dump current config to stdout (default)
nexuslims config dump

# Dump current config to a file
nexuslims config dump --output /path/to/nexuslims_config.json

# Load a previously dumped config into .env
nexuslims config load nexuslims_config.json
nexuslims config load nexuslims_config.json --env-path /path/to/.env
nexuslims config load nexuslims_config.json --force

Security#

The dump output is not sanitised — it contains live API tokens and passwords exactly as they appear in the running configuration. A warning is printed to stderr every time dump is invoked. The load command will back up any pre-existing .env file before overwriting.

Module Contents#

Functions#

main

Manage NexusLIMS configuration files.

dump

Dump the current effective configuration to JSON.

edit

Interactively edit the NexusLIMS configuration in a terminal UI.

labarchives_get_uid

Look up your LabArchives user ID (UID) using your login credentials.

load

Load a previously dumped JSON config into a .env file.

Data#

API#

nexusLIMS.cli.config.logger#

‘getLogger(…)’

nexusLIMS.cli.config.main() None#

Manage NexusLIMS configuration files.

nexusLIMS.cli.config.dump(output: str | None) None#

Dump the current effective configuration to JSON.

By default, prints the configuration to stdout. Use –output to write to a file.

The output contains live API tokens and passwords — handle it like a secret. Use load to import a previously dumped file back into a .env.

nexusLIMS.cli.config.edit(env_path: str) None#

Interactively edit the NexusLIMS configuration in a terminal UI.

Opens a tabbed form pre-populated from the existing .env file (if any). Press Ctrl+S to save and write the .env file, or Escape to cancel without saving.

nexusLIMS.cli.config.labarchives_get_uid(email: str, la_password: str, env_path: str, *, verbose: bool) None#

Look up your LabArchives user ID (UID) using your login credentials.

Reads NX_LABARCHIVES_ACCESS_KEY_ID, NX_LABARCHIVES_ACCESS_PASSWORD, and NX_LABARCHIVES_URL from your .env file (or environment), then calls the LabArchives API to retrieve the UID for the provided email address.

This command does NOT require a fully-configured NexusLIMS environment — only the three NX_LABARCHIVES_* fields listed above need to be set.

The UID is printed along with a ready-to-paste .env line:

 NX_LABARCHIVES_USER_ID=

Note: –la-password is your personal LabArchives account password or app token, NOT the NX_LABARCHIVES_ACCESS_PASSWORD signing secret.

nexusLIMS.cli.config.load(input: str, env_path: str, *, force: bool) None#

Load a previously dumped JSON config into a .env file.

INPUT is the path to the JSON file produced by dump.

If a .env file already exists at ENV_PATH a timestamped backup is created before it is overwritten.