CLI Reference
scripts/lens-local.sh (local source installation and services)
| Command | Purpose |
|---|---|
scripts/lens-local.sh check | Validate the environment without starting anything. |
scripts/lens-local.sh start | Prepare dependencies and start the frontend, Node API and Python backend in the background. Logs are under $LENS_LOG_DIR/dev/ (default ~/.local/state/lens/logs/dev/). Regenerates and validates the reuse map first. |
scripts/lens-local.sh stop | Stop all services started by this script. |
scripts/lens-local.sh restart | Complete target-node checks when enabled, prepare dependencies and validate the reuse map before stopping and restarting services. |
scripts/lens-local.sh status | Show which services are running and their PIDs. |
scripts/lens-local.sh clean [-y|--yes] | Stop services and delete the embedded database plus all local app data under ~/.llm-d-lens. |
scripts/lens-local.sh install-node | Install a supported Node.js into .dev-tools/ (used automatically if the system Node is missing or too old). |
Ports are configurable via FRONTEND_PORT, SERVER_PORT and BACKEND_PORT
environment variables; see Environment Variables.
Target node and kubeconfig
check, start and restart accept --target-node NODE and
--kubeconfig FILE. Flags override TARGET_NODE and KUBECONFIG.
The kubeconfig flag accepts one file, relative to the directory where you invoke
the command; inherited KUBECONFIG file lists are preserved.
scripts/lens-local.sh restart --target-node node-a --kubeconfig "$HOME/.kube/config"
TARGET_NODE=node-a KUBECONFIG="$HOME/.kube/config" scripts/lens-local.sh check
No dedicated target-node configuration file is loaded, and targets are not
persisted: supply the target on each invocation or export TARGET_NODE in your
shell. Without a target,
ordinary startup does not query Kubernetes or require kubectl/jq. With a target,
the launcher requires kubectl, jq and an LLM_D_ROOT checkout containing guides/,
then checks that the node is accessible, Ready and not cordoned before any
existing services are stopped. This is not a guarantee that a particular
workload's resource requests, affinity or tolerations can be scheduled.
The target is exported to the existing backend/Node contract
PRISM_K8S_TARGET_NODE. That variable also remains a fallback when TARGET_NODE
is unset. When KUBECONFIG is unset, Kubernetes uses its normal configuration
lookup. stop, status, clean and install-node do not perform target-node
checks; target flags are rejected for those commands.
Hardware discovery stays in the backend and hardware profiles. The launcher
does not discover an Intel-specific PCI allowlist; an explicitly supplied
PRISM_GPU_PCI_ALLOWLIST is preserved. It also does not inject deployment-runtime
defaults: without overrides, the backend uses namespace prefix llmd-, readiness
timeout 900 seconds, command timeout 300 seconds and retains failed namespaces.
Explicit LLM_D_BENCH_* overrides remain supported by their existing consumers.
lensctl.sh (installed deployments)
Written into the install directory by the Ubuntu installer:
| Command | Purpose |
|---|---|
lensctl.sh start | Start the installed deployment's services. |
lensctl.sh status | Show whether services are running. |
lensctl.sh stop | Stop the installed deployment's services. |
lensctl.sh uninstall | Uninstall; --keep-data / --purge control data, --keep-db / --purge-db control the embedded database. |
LensInstaller-Ubuntu-x86_64-online.sh
Download from main or a release tag containing the online installer; the script selects its embedded version. Only new or empty install directories are accepted. There is no version override or upgrade mode.
| Flag | Purpose |
|---|---|
--install-dir DIR | Install location (default $HOME/llm-d-lens). |
--app-port PORT | Web app/API port (default 3000). |
--backend-port PORT | Internal FastAPI backend port (default 8081). |
--silent | Non-interactive install using defaults/flags only. |
--no-https | Serve plain HTTP instead of auto-HTTPS. |
--no-start | Install without starting services. |
--db-mode embedded|external | Use the built-in database or an external one. |
--no-apt | Fail instead of installing missing system packages with apt. |
-h, --help | Show every option. |
See Installation and Upgrade for full usage.
node scripts/generate-mcp-tools.mjs
Regenerates the MCP tool catalog the Node BFF exposes to
Lens Assistant from the backend's current API
surface. Run it whenever backend routes change; scripts/lens-local.sh start/restart and Docker builds do this automatically.
alembic
Applies or authors database schema migrations — see Migration.