# BMCLI Offline Package

`VERSION` is the customer product version. `BUILD_INFO.json` records the
independent Bamboo build number and Git commit. Release notes are under
`share/bmcli/doc/changelist.txt`.

Installation, update, rollback, prerequisites, and uninstall procedures are in
`share/bmcli/doc/installation.md`. Use is governed by `LICENSE.txt`.

BMCLI is self-contained in this directory. It does not require a system-wide
BMAPI installation because the matching runtime library is stored in `bin/`.

## Run Without Installation

Windows PowerShell:

```powershell
.\bin\bmcli.exe doctor
```

Linux:

```sh
./bin/bmcli doctor
```

## Install For The Current User

Windows packages can be installed with the bundled installer under
`share/bmcli/packaging/install.ps1`. Linux packages provide a root-level
installer:

```sh
./install.sh
```

The default Linux locations are `~/.local/share/bmcli` and `~/.local/bin`.
Add `~/.local/bin` to `PATH` when your distribution does not do so already.
The installer also links `bmcli(1)` into `~/.local/share/man/man1`; the complete
AI-oriented reference remains `share/bmcli/doc/bmcli_reference.md`.

The package includes the Web engineering console and exact v1 contract under
`share/bmcli/web/`. After opening the required daemon channels, start it with:

```sh
bmcli web start --listen=127.0.0.1:8080
```

Open `http://127.0.0.1:8080/` or read
`http://127.0.0.1:8080/api/v1/openapi.json`. Keep the default loopback listener;
a non-loopback listener requires an explicit token and `--allow-insecure-http`
acknowledgement. The embedded server uses plain HTTP, so the token authenticates
but does not encrypt traffic. Use a
non-loopback listener only on a trusted isolated engineering network with a host
firewall, or behind an approved HTTPS reverse proxy.

An Nginx HTTPS profile and renderer are installed under
`share/bmcli/packaging/https/`. Keep BMCLI on `127.0.0.1:8080`, provide a
browser-trusted certificate, and follow that directory's README. The proxy
configuration disables buffering for SSE/WebSocket traffic and does not require
disabling HTTPS-first or certificate validation.

The typed API can inspect bench/device/job state, open/configure/close daemon
channels, read channel statistics, manage database resources, TX tasks, routes,
logging/replay/gateway lifecycle, send messages, and consume raw or decoded
streams. It also exposes bounded XCP status and operations through
`GET/POST /api/v1/xcp`; general database, upload, authentication, reporting, and
durable time-series concerns belong to the surrounding application backend.
Database, logging, and replay paths must remain inside the BMCLI project
working directory.
Use the live OpenAPI document for exact paths and fields; encode a `/` inside a
path selector (`10356/0` becomes `10356%2F0`).

Linux USB access may require the optional udev rule. Review it before installing:

```sh
./install.sh --install-udev
```

Reconnect the BUSMUST device after installing the rule. The installer never
changes udev configuration unless `--install-udev` is specified.

Use `bmcli update` for stable online updates or `bmcli update
--version=X.Y.Z` to select an archived release. The bundled uninstallers are
under `share/bmcli/packaging/`.
