Scripting & Automation
pcu-cli is built to be scripted. Data goes to stdout; prompts, warnings, and errors go to stderr; and every command sets a meaningful exit code. This page covers the flags and output formats you need for unattended use. For the full command list, see the Command Reference.
Output discipline
Section titled “Output discipline”- stdout carries the data: the status table, timer values, channel states, and all JSON.
- stderr carries confirmation prompts, warnings, and error messages.
Because prompts and warnings never touch stdout, you can capture clean data with pcu-cli ... > out.txt while any prompt still appears on the terminal.
| Flag | Description |
|---|---|
--quiet | Bare values only, one per line. Also skips confirmation prompts. |
--json | JSON output. Supported on status, ign, dio, and version. |
--yes, -y | Skip write confirmation prompts. |
--version, -V | Print version info and exit. Runs without elevation. |
-h, --help, /? | Print command help and exit. |
Notes:
--quietimplies--yes: quiet writes never prompt.--jsonon its own still prompts before a write. Add--yesfor unattended writes.--jsonand--quiethave no effect ondriver; its output is always the text form.pcu-clireads no environment variables and no configuration files. Everything is passed on the command line.
JSON output
Section titled “JSON output”status, ign, dio, and version emit a single indented JSON object on stdout. Errors still go to stderr, and the exit code is unchanged, so a script can branch on either.
status --json on a CQ20:
{ "platform": "In-CarPC CQ20", "cpu": "Intel Atom x6425E", "mcu_identity": "CQ20 MCU", "hardware_rev": "DTB-IGN-MCU VER:10", "firmware": 12, "ignition": { "mode": 1, "ign_on_delay_s": 6, "sw_on_delay_s": 4, "sw_off_delay_s": 300, "pw_off_delay_s": 120 }}ign --json is the timer summary on its own:
{ "mode": 1, "ign_on_delay_s": 6, "sw_on_delay_s": 4, "sw_off_delay_s": 300, "pw_off_delay_s": 120}A single ign get read is { timer, value }, with the value in seconds:
{ "timer": "sw-off-delay", "value": 300}A write reports the requested value, the value read back, and whether they match:
{ "timer": "sw-off-delay", "requested": 120, "actual": 120, "verified": true}dio --json on a CQ40 series reports each channel as a boolean (true = High for a channel, On for the ignition line):
{ "platform": "In-CarPC CQ40 series", "inputs": { "di1": false, "di2": false }, "outputs": { "do1": false, "do2": false }, "ignition": true}A dio set write mirrors the ign set shape, with booleans:
{ "channel": "do1", "requested": true, "actual": true, "verified": true}version --json is the full inventory record: build stamp, driver and module versions, and the supported-platform catalogue. Use it for fleet inventory without touching the hardware bus.
{ "app": "pcu-cli", "version": "1.0.0", "git_commit": "a1b2c3d", "build_date": "2026-07-01 09:15:32 UTC", "build_config": "Release", "os": "Windows", "pawnio_version": "2.2.0", "pawnio_date": "2026-03-15", "smbus_module_date": "2025-05-05", "lpcio_version": "0.2.7", "lpcio_date": "2026-06-03", "platforms": [ { "model": "CQ20", "description": "In-CarPC CQ20", "cpu": "Intel Atom x6425E", "cpu_codename": "Elkhart Lake", "bus": "PCH SMBus", "features": "Ignition timers", "tested_os": [ "Windows 11 25H2 (x64)", "Ubuntu 24.04 LTS (x64)" ] }, { "model": "CQ40", "description": "In-CarPC CQ40 series", "cpu": "Intel (CQ41/CQ43/CQ47)", "cpu_codename": "Haswell", "bus": "SuperIO GPIO ports", "features": "Digital I/O", "tested_os": [ "Windows 10 22H2 (x64)" ] } ], "validated_configs": [ "Windows 11 25H2 (x64) - CQ20", "Ubuntu 24.04 LTS (x64) - CQ20", "Windows 10 22H2 (x64) - CQ40" ]}JSON field notes
Section titled “JSON field notes”- Fields that do not apply are omitted, not set to null. On a CQ40,
status --jsonhas noignitionblock; on a CQ20 it has noinputsoroutputs. On Linux,version --jsonomits thepawnio_*,smbus_module_date, andlpcio_*fields. - Boolean channel values are
truefor High (inputs and outputs) andtruefor On (the ignition line). - On a write, the exit code mirrors the
verifiedfield: 0 when the readback matches, 1 when it does not. A script can check either. git_commit,build_date, andbuild_configinversion --jsonare stamped at build time and will differ from the example above.
Quiet mode
Section titled “Quiet mode”--quiet prints just the value, with no labels or headers, one per line. It is the simplest form to parse and it never prompts. Reads:
$ pcu-cli ign get sw-off-delay --quiet300$ pcu-cli dio get di1 --quiet0Writes print the value read back, and still set the exit code from the readback:
$ pcu-cli dio set do1 1 --quiet1Examples
Section titled “Examples”Assert a digital output at boot. On Linux, run this from a systemd unit or an @reboot cron job:
pcu-cli dio set do1 1 --yesOn Windows, run the same command from a Task Scheduler task set to trigger “At startup”:
pcu-cli.exe dio set do1 1 --yesCollect a fleet inventory without touching the hardware bus:
pcu-cli version --json > inventory.jsonChange the shutdown delay across a fleet and fail loudly if the write did not verify:
pcu-cli ign set sw-off-delay 120 --yes --quietif ($LASTEXITCODE -ne 0) { Write-Error "write not verified" }Extract a single value with jq:
pcu-cli ign get sw-off-delay --json | jq '.value'Cancelling
Section titled “Cancelling”pcu-cli handles Ctrl+C gracefully: an in-flight bus transfer is allowed to finish and the transport is cleaned up before the tool exits, so a cancel never leaves a transfer half-done.
Thread and process safety
Section titled “Thread and process safety”pcu accesses the hardware bus directly. To avoid clashing with other low-level tools, every transfer is serialized on the standard system-wide bus mutexes also used by tools like HWiNFO (Access_SMBUS.HTP.Method for SMBus, Access_ISABUS.HTP.Method for SuperIO port I/O). Each access waits up to 5 seconds for the bus, then fails cleanly.
