BMCLI Help and documentation contract
The installed executable is authoritative for current command discovery, syntax, option names, required/default values, units, aliases, and short safety notes:
bmcli helpbmcli help devicebmcli help channel autosetbmcli channel autoset --helpbmcli help channel autoset --format=jsonUse JSON Help when an AI or script needs the exact contract of the installed version. This Reference adds detailed behavior, output schemas, protocol semantics, workflows, and extended examples; it must agree with Help but is not a second independently maintained option inventory. The Linux man page only points to local Help and this Reference and contains no independent command facts.
Common conventions:
| Concept | Format | Examples |
|---|---|---|
| Channel | --channel=<SPEC> |
See Channel Specification below |
| CAN ID | --message=<ID> or --id=<ID> |
0x123 (hex), 0x18FEDC01 (29-bit ext), 299 (decimal) |
| Flags | --flags=<FLAGS> |
fdf+brs+ide+rtr (plus-separated) |
| Data | --data=<HEX> |
"AA BB CC DD" (space-separated hex bytes) |
| Bitrate | --bitrate=<N> |
500, 500K, 500000, and 500,000 all mean 500 kbps; 1M and 1000000 mean 1000 kbps |
| Mode | --mode=<MODE> |
normal, listen-only, loopback, internal-loopback, external-loopback |
| CAN termination | --termination=<VAL> |
120, off |
| LIN pull-up | --pullup=<VAL> |
1k, off |
| Channel power | `channel power <status | on |
Structured output and exit contract
Section titled “Structured output and exit contract”Use --format=json for bounded commands and --format=jsonl for streams.
- A bounded JSON command writes exactly one JSON document to stdout.
- Successful documents contain
"status":"ok"; failed documents contain"status":"error"pluserror.code,error.message,error.details, anderror.retryable. A top-levelmessageremains available for CLI consumers. - Bounded
message recv --format=jsonreturns one object with amessagesarray and summary fields. Use JSONL when each frame must be consumed as it arrives. - JSONL writes one object per line. Progress and warning records use an
eventfield while retainingstatus; CAN receive records are independently parseable objects. - Non-fatal human notes and warnings may be written to stderr and do not corrupt JSON stdout.
- Process exit code
0means the requested command completed successfully. Exit code1covers usage, configuration, environment, transport, hardware, timeout, and negative UDS response failures. Inspect JSON fields such aserror.code,nrc, and protocol-specific details to classify the failure instead of relying on additional exit-code values. - A successful inspection can report a domain state such as
DEGRADED; a validation with missing required values reportsstatus=errorand exits 1.
Existing fields keep their meaning within a major product version. New fields
may be added, so consumers must ignore unknown members. CAN IDs are hexadecimal
strings, booleans are JSON booleans, and units are carried in field names such
as _kbps, _ms, and _seconds.
Channel Specification
Section titled “Channel Specification”The --channel parameter supports three forms:
| Form | Syntax | Example | Description |
|---|---|---|---|
| SN/port | SN/PORT |
10356/0 |
Device serial number + port number |
| UID/port | UID/PORT |
423BAE5191B9/0 |
Device UID (12 alphanumeric characters) + port number |
| Legacy | N |
0, 0,1, 0-3 |
Enumerate index (backward compatible) |
Auto-detection rules (for the part before /):
- Alphanumeric, length 12 → UID
- All digits, length 4-6 → SN
- No
/found → legacy numeric index
Recommendation: use SN/port in scripts, AI instructions, saved bench profiles, and customer documentation. A legacy numeric index is suitable only for short-lived interactive work after inspecting the current enumeration result.
Why SN/port? USB enumeration order is OS-dependent — the same device may appear at different indices across BM_Enumerate() calls. SN/port identification ensures deterministic device selection regardless of enumeration order.
# Open specific device by SN + portbmcli daemon start --channel=10356/0,10356/1bmcli channel open --channel=10356/0 --nbitrate=500k
# Multi-device: open ports on different devicesbmcli daemon start --channel=10356/0,10357/0
# Legacy (still supported, order-dependent)bmcli daemon start --channel=0,1Source of truth: bmcli_reference.md in the BMCLI repository. Run bmcli help <category> <action> --format=json for the exact contract of the installed version.