Skip to main content
WUJI CLI is a command-line tool for WUJI devices, built for terminals, scripts, and AI Agents. Scan devices, probe connectivity, read and write parameters, subscribe to real-time data, calibrate tactile sensing, run health diagnostics, and upgrade firmware — all without leaving the terminal.

Command Overview

Add --help after any command for detailed usage.

Design Principles

  • Stateless: Each command completes its own connect-operate-disconnect cycle. No connection persists between commands, so there’s no separate “connect” step.
  • Read-only fallback when occupied: Device firmware allows only one direct session at a time. When another host application occupies the device, the CLI falls back to read-only access, and set operations are rejected.
  • Scriptable exit codes: Use the exit code to distinguish success, invalid arguments, refused operations, and unavailable devices.

Output Modes

All commands print tables or tree reports by default. Add a global flag to switch to structured output:

Error Output

In --json and --jsonl modes, errors go to stdout with the following structure. hint is an empty string when no suggestion is available. Some errors also include docs or additional context fields.
The default terminal output sends errors and suggestions to stderr. In scripts, check the exit code and use error.reason to identify the failure. Don’t match the wording of error.message. Errors before execution return the error structure above directly. During execution, commands can retain their result fields and attach error to the same JSON object. Read error.reason in either form. For example, capture stdout and check the exit code in a Bash script with jq installed:
wuji viz is an exception: after the command starts, startup and runtime errors go to stderr because stdout is reserved for the Viewer startup report. Parameter parsing and option-admission errors still go to stdout. See Structured Output. The hand model calibration command retains its progress and final event format.

Exit Codes

On Unix, Ctrl+C ends the process with SIGINT after cleanup. Shells report 130, while Python subprocess.returncode reports -2. Canceling device selection in viz or an active doctor check returns exit code 130 (interrupted). Hand model calibration has its own cancellation behavior. On Windows, interruption exits with 0xC000013A.