跳转到内容

BMCLI bench

命令名、参数与机器可读字段保持英文,以便直接复制到终端或交给 AI 使用;当前安装版本的精确契约请以 bmcli help ... --format=json 为准。

bench is the first-party configuration layer shared by users, AI harnesses, shell scripts, and Python automation. One .bmcli directory is one target and one bench; that bench may contain multiple logical networks and physical channels. It separates portable target/network/node intent from machine-local analyzer identity, wiring, and paths:

  • .bmcli/target.json may be versioned with the project.
  • .bmcli/bench.local.json is local and is ignored by the generated .bmcli/.gitignore.
Terminal window
bmcli bench init --target=vehicle-a --kind=vehicle \
--network=vehicle-can --channel=10356/0 --nbitrate=500 --dbitrate=2M
bmcli bench init --network=sensor-private-can --node=sensor-controller \
--channel=10356/1 --nbitrate=500 --dbitrate=2M --termination=120 \
--request-id=0x791 --response-id=0x799 --database=network/body.dbc \
--validated-by=enumerate+autoset+uds-discover
bmcli bench show --format=json
bmcli bench validate --format=json
bmcli bench validate --hardware --format=json

bench init updates the selected network, node, and local connection while preserving all other entries. The first network and node become defaults. It accepts repeatable, protocol-neutral --database references for DBC, LDF, A2L, or future supported database types; --database=none clears the list. --dbc is a mutually exclusive single-DBC convenience form. It rejects order-dependent numeric channel indices. It does not enumerate, AutoSet, transmit a functional UDS request, or stop/start the daemon; perform those separately with the applicable authorization, then persist confirmed results. --force is required to replace malformed existing JSON. Use --global only to create or update the per-user fallback.

Without an explicit --project, BMCLI searches from the current directory to the nearest parent .bmcli; when none exists it reads the per-user default. Project and global profiles are not merged. An explicit physical channel always works as before. A configured logical name is also accepted wherever the existing --channel option is accepted:

Terminal window
bmcli message recv --channel=vehicle-can --duration=10 --format=jsonl
bmcli message recv --channel=10356/0 --duration=10 --format=jsonl

The client resolves logical names to local physical bindings before BMAPI access or daemon forwarding. Node definitions are returned by bench show; automatic selection of one diagnostic node among several is not performed.

bench validate checks network/node/connection references, required timing, database and local paths, and stable persisted channels. With --hardware, it also enumerates every configured binding and verifies that channel capabilities match the declared bus. Its state is READY, DEGRADED (for example, no DBC but raw CAN remains possible), or NEEDS_INPUT; required-value, stale-path, JSON, capability, and hardware mismatch failures return nonzero.

The complete schema, ownership, lookup, and acceptance contract is recorded in bench_configuration_plan.md.



权威来源: bmcli_reference.md in the BMCLI repository. Run bmcli help <category> <action> --format=json for the exact contract of the installed version.