AI Lab Command Line Interface

Notebook Connector installs the ai-lab command line interface for working with the bundled Jupyter notebooks.

The top-level ai-lab command exposes exactly two subcommands:

  • start starts JupyterLab and deploys the bundled notebooks into the notebook root directory if they are not present yet.

  • deploy-notebooks copies the bundled notebooks to a target directory without starting JupyterLab through Notebook Connector.

Help

Use --help on the top-level command or any subcommand to inspect the current option set.

ai-lab --help
ai-lab start --help
ai-lab deploy-notebooks --help

Command start

Command start launches JupyterLab by invoking python -m jupyter lab. Before JupyterLab starts, Notebook Connector copies the bundled notebooks into the notebook root directory leaving existing files unchanged, and exports NOTEBOOKS for the launched JupyterLab session.

ai-lab start

Common options:

Option

Meaning

--port

JupyterLab listen port. Default: 49494.

--ip

Bind address. Default: localhost. Use 0.0.0.0 to allow remote access from arbitrary other addresses.

--notebook-dir

JupyterLab root directory. If omitted, the current working directory is used as the notebook root. Missing directories are created.

--no-browser

Prevent JupyterLab from opening in the default browser.

Examples:

ai-lab start --port 9999 --ip 0.0.0.0
ai-lab start --notebook-dir ~/work/notebooks --no-browser

Failure cases:

  • If JupyterLab is not installed, the command exits with an install hint for poetry install --all-extras.

  • If --notebook-dir points to a file instead of a directory, the command exits with an error.

Command deploy-notebooks

Command deploy-notebooks copies the packaged notebooks to a target directory and reports how many files were copied or skipped. Use it when you already manage your own JupyterLab environment and want to make the bundled notebooks available there.

ai-lab deploy-notebooks --target-dir ~/notebooks

Options:

Option

Meaning

--target-dir

Required destination directory.

--overwrite / --no-overwrite

Overwrite existing files in the target directory. Default: --no-overwrite.

If --overwrite is not set, existing files are preserved and counted as skipped.