> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wuji.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Firmware Upgrade

> Check for firmware updates, upgrade devices in batch, install a specific version, or flash a local firmware file with wuji upgrade

When new device firmware is available, upgrade with `wuji upgrade`. It fetches firmware matched to each device from the official catalog, verifies it, flashes it over the current transport, and prints a per-device report. The device reboots into the new firmware automatically.

## Scope and Action

Every invocation combines a **scope** (which devices) with an **action** (which version).

Scope:

* No scope flag: when only one device is connected, the scope flag is optional
* `--all`: every discovered device (latest firmware only)
* `--type <TYPE>`: every device of one type, such as `--type wuji_glove` (matches `ping`'s Device Type column, case-insensitive)
* `--sn` / `--address` / `--handedness`: one device, same selectors as other commands

Action:

* No action flag: upgrade the scoped devices to their latest versions
* `--to <VERSION>`: install a specific version on the scoped devices
* `--file <PATH>`: flash an official ZIP package or a standalone Wuji `.bin` firmware file onto the scoped devices
* `--list`: browse available firmware versions, requires one device type or one device, read-only
* `--check`: check all connected devices for firmware updates, works with any scope, read-only

A version number only makes sense for one device type, so `--to`, `--file`, and `--list` require a single-type scope: `--type` or one device. `--all` always means "latest for each device".

## Usage

```bash theme={null}
wuji upgrade --check                        # which devices have firmware updates (read-only)
wuji upgrade --all                          # upgrade every device to its latest
wuji upgrade --sn <SN>                      # upgrade one device to its latest
wuji upgrade --sn <SN> --to 0.11.0          # install a specific version on one device
wuji upgrade --type wuji_glove --to 0.11.0   # install a specific version on every device of one type
wuji upgrade --sn <SN> --list               # list firmware versions available for one device
wuji upgrade --file fw.zip                  # flash a local firmware package
wuji upgrade --file firmware.bin            # flash a standalone Wuji firmware file
```

Without a device selector, single-device actions auto-pick the only connected device. With several devices on the bus, the CLI errors out listing candidate SNs — pick one with `--sn`.

## Local Firmware Files

`--file` identifies the firmware format from the file contents, not the extension. It accepts these formats:

* **Official ZIP package**: the CLI verifies the package manifest and firmware digest before flashing.
* **Standalone Wuji `.bin` firmware**: the CLI flashes the file as-is. It has no manifest, so the CLI cannot verify its digest, device type, or version. The confirmation prompt marks the file as `UNVERIFIED`.

Any other file triggers `not a firmware file` before the CLI connects to a device. If a standalone `.bin` file doesn't match the target device type, flashing can still fail. The failure report then asks you to confirm that the firmware matches the target device type.

## Read the Report

* One row per device: `Status` is `ok` / `skipped` / `failed`, and the `Detail` column carries the failure reason or skip note
* **Exit code**: 0 unless a device `failed` (`skipped` doesn't count as failure) — ready for script assertions
* `--check` exits 0 whether or not updates exist, and returns 1 only when the query itself fails. To gate scripts on update availability, use the `status` field in `--json` output

## Examples

`wuji upgrade --check` gives a read-only overview of all devices:

```bash theme={null}
$ wuji upgrade --check
1/2 device(s) have updates available
┌──────────────────┬─────────────┬─────────┬────────┬──────────────────┐
│ SN               ┆ Device Type ┆ Current ┆ Latest ┆ Status           │
╞══════════════════╪═════════════╪═════════╪════════╪══════════════════╡
│ WG1KXXXXXXXXX001 ┆ wuji_glove   ┆ 0.11.0  ┆ 0.11.1 ┆ update available │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ WG1KXXXXXXXXX002 ┆ wuji_glove   ┆ 0.11.1  ┆ 0.11.1 ┆ up to date       │
└──────────────────┴─────────────┴─────────┴────────┴──────────────────┘
```

`wuji upgrade --all` confirms the plan, then flashes each device in turn and prints a report:

```bash theme={null}
$ wuji upgrade --all
firmware: 0.11.1 (157.15 KiB, released 2026-06-24)
  - Fixed an incorrect IMU initialization warning.
device(s) to upgrade (2):
  WG1KXXXXXXXXX001 (0.11.0 → 0.11.1)
  WG1KXXXXXXXXX002 (0.11.0 → 0.11.1)
proceed? [y/N] y

2 upgraded (2 device(s))
┌──────────────────┬────────┬────────┬────────┬──────────┐
│ SN               ┆ Status ┆ Before ┆ After  ┆ Duration │
╞══════════════════╪════════╪════════╪════════╪══════════╡
│ WG1KXXXXXXXXX001 ┆ ok     ┆ 0.11.0 ┆ 0.11.1 ┆ 16s      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ WG1KXXXXXXXXX002 ┆ ok     ┆ 0.11.0 ┆ 0.11.1 ┆ 16s      │
└──────────────────┴────────┴────────┴────────┴──────────┘
```

Devices already on the target version are skipped, and the `Detail` column says why:

```bash theme={null}
$ wuji upgrade --all --yes
0 upgraded, 2 skipped (2 device(s))
┌──────────────────┬─────────┬────────┬───────┬──────────┬───────────────────┐
│ SN               ┆ Status  ┆ Before ┆ After ┆ Duration ┆ Detail            │
╞══════════════════╪═════════╪════════╪═══════╪══════════╪═══════════════════╡
│ WG1KXXXXXXXXX001 ┆ skipped ┆ 0.11.1 ┆ -     ┆ -        ┆ already on 0.11.1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ WG1KXXXXXXXXX002 ┆ skipped ┆ 0.11.1 ┆ -     ┆ -        ┆ already on 0.11.1 │
└──────────────────┴─────────┴────────┴───────┴──────────┴───────────────────┘
```

Installing a version below the current one is flagged in the prompt:

```bash theme={null}
$ wuji upgrade --sn WG1KXXXXXXXXX001 --to 0.11.0
firmware: 0.11.0 (155.68 KiB, released 2026-06-18)
  - Updated tactile output to the new 24×31 matrix format.
device(s) to upgrade (1):
  WG1KXXXXXXXXX001 (0.11.1 → 0.11.0)  ⚠ DOWNGRADE
proceed? [y/N]
```

## Structured Output

`--json` prints a structured report with the same fields as the tables, for scripting. Flashing actions require `--yes` together with `--json` / `--jsonl`:

```bash theme={null}
wuji upgrade --check --json
wuji upgrade --all --yes --json
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.