CLI reference
Overview
The SiFi Bridge REPL (Read-Eval-Print Loop) provides an interactive interface for managing and controlling SiFi Labs devices. It supports command chaining with semicolons and outputs responses in JSON format (use the -p/--pretty flag for pretty-printed JSON).
At any point in the REPL, use help [command] to show a command's help message, including its options and value ranges.
Starting the REPL
# Start the REPL (default mode)
./sifibridge
# Start the REPL with pretty-printed JSON output
./sifibridge --pretty
Working with devices
A device session is created by connect, which both opens the BLE (or serial) link and registers the device internally, keyed by its stable BLE id. When several devices are connected, select switches which one subsequent commands target, and many commands accept an --all flag to act on every connected device at once. disconnect closes the link and removes the session.
Command chaining
Multiple commands can be chained on a single line, separated by semicolons:
> connect; show; start
Device and session commands
list
List devices from a given source.
Usage:
list <FROM>
Arguments:
<FROM>- Source to list from:ble- Scan for Bluetooth Low Energy devicesserial- List serial portsdevices- List currently connected device sessions
connect
Connect to a device. On success a new session is created (keyed by the device's stable BLE id) and selected as the active device.
Usage:
connect [HANDLE]
Arguments:
[HANDLE](optional) - Connection handle:- Empty: auto-connect to the first matching device
- BLE device name (e.g.
BioPoint) - Windows/Linux: BLE MAC address (e.g.
00:11:22:33:44:55) - macOS: BLE UUID (e.g.
00001122-3344-5566-7788-99AABBCCDDEE)
Examples:
# Auto-connect to first available device
> connect
# Connect by device name
> connect my_bp
# Connect by MAC address (Windows/Linux)
> connect 00:11:22:33:44:55
disconnect
Disconnect from a device and remove its session. With no argument, disconnects the active device. After disconnection, the next remaining device (if any) becomes active.
Buffered acquisitions for the device are retained — use buffer clear to drop them.
Usage:
disconnect [HANDLE]
Arguments:
[HANDLE](optional) - Device id or BLE local name. Defaults to the active device.
select
Select which device subsequent commands target. The argument can be the device id (BLE MAC/UUID) or the device's local name. If multiple devices share a name, the id must be used to disambiguate.
Usage:
select <HANDLE>
Arguments:
<HANDLE>- Device id or local name
rename
Rename the current device.
Usage:
rename [OPTIONS] [NAME]
Arguments:
[NAME](optional) - New device name
Options:
--reset- Reset the device's name to its factory default
Examples:
> rename right_arm_bp
> rename --reset
Custom names are limited to 14 characters and must be valid ASCII.
info
Print device information for the current device, including its complete configuration, as JSON.
Usage:
info
Configuration commands
configure
Configure the current device, or all devices when --all is set. The configure command has subcommands for each sensor and device-level setting.
Usage:
configure [--all] <COMMAND>
Subcommands: sensors, ecg, emg, eda, ppg, imu, filtering, temperature, high-gain, memory, low-latency, ble-power, night.
Use help configure <subcommand> for the exact options and value ranges of each.
configure sensors
Enable or disable which sensors are active. This is how sensors are turned on and off — the per-sensor subcommands below adjust settings but do not change the on/off state.
Usage:
configure sensors [OPTIONS]
Options (each takes off or on; omitted sensors keep their current state):
--ecg <ECG>--emg <EMG>--eda <EDA>--imu <IMU>--ppg <PPG>
Example:
configure sensors --ecg on --ppg on --imu off
configure ecg
Configure the ECG (Electrocardiography) sensor.
Usage:
configure ecg [OPTIONS]
Options:
--fs <FS>- Sampling rate in Hz (250,500,1000,2000)--dc-notch <DC_NOTCH>- Enable DC notch (off,on)--mains-notch <MAINS_NOTCH>- Enable mains notch (off,50,60)--bandpass <BANDPASS>- Enable bandpass filter (off,on)--bandpass-low <BANDPASS_LOW>- Bandpass lower cutoff frequency (Hz)--bandpass-high <BANDPASS_HIGH>- Bandpass higher cutoff frequency (Hz)
Example:
configure ecg --fs 250 --mains-notch 60 --bandpass on --bandpass-low 0.5 --bandpass-high 40
configure emg
Configure the EMG (Electromyography) sensor.
Usage:
configure emg [OPTIONS]
Options:
--fs <FS>- Sampling rate in Hz (500,1000,1600,2000)--dc-notch <DC_NOTCH>- Enable DC notch (off,on)--mains-notch <MAINS_NOTCH>- Enable mains notch (off,50,60)--bandpass <BANDPASS>- Enable bandpass filter (off,on)--bandpass-low <BANDPASS_LOW>- Bandpass lower cutoff frequency (Hz)--bandpass-high <BANDPASS_HIGH>- Bandpass higher cutoff frequency (Hz)
Example:
configure emg --fs 1000 --bandpass on --banspass-low 20 --bandpass-high 450
configure eda
Configure the EDA/BIOZ (Electrodermal Activity / Bioimpedance) sensor.
Usage:
configure eda [OPTIONS]
Options:
--fs <FS>- Sampling rate in Hz (4,8,16,32,50)--dc-notch <DC_NOTCH>- Enable DC notch (off,on)--mains-notch <MAINS_NOTCH>- Enable mains notch (off,50,60)--bandpass <BANDPASS>- Enable bandpass filter (off,on)--bandpass-low <BANDPASS_LOW>- Bandpass lower cutoff frequency (Hz)--bandpass-high <BANDPASS_HIGH>- Bandpass higher cutoff frequency (Hz)--freq <FREQ>- Signal frequency in Hz (0for DC)
Example:
configure eda --fs 50 --freq 0
configure ppg
Configure the PPG (Photoplethysmography) sensor.
Usage:
configure ppg [OPTIONS]
Options:
--sps <SPS>- Raw AFE sample rate in Hz (50,100,200,400,800). The effective output rate is this divided by--avg, and is reported live in each packet'ssample_rate.--led-ir <IIR>- IR LED current in mA (0-50)--led-red <IRED>- Red LED current in mA (0-50)--led-green <IGREEN>- Green LED current in mA (0-50)--led-blue <IBLUE>- Blue LED current in mA (0-50)--sens <SENS>- Sensor sensitivity (low,medium,high,max)--avg <AVG>- Signal averaging factor (1,2,4,8,16,32)
Example:
configure ppg --sps 100 --iir 50 --ired 30 --sens high --avg 4
configure imu
Configure the IMU (Inertial Measurement Unit).
Usage:
configure imu [OPTIONS]
Options:
--fs <FS>- Sampling rate in Hz (25,50,100,200)--acc-range <ACC_RANGE>- Accelerometer range in g (2,4,8,16)--gyro-range <GYRO_RANGE>- Gyroscope range in dps (16,31,63,125,250,500,1000,2000)
Example:
configure imu --fs 100 --acc-range 4 --gyro-range 500
configure memory
Set the memory mode. Data can be stored in the device's internal memory and/or streamed over BLE to the host.
Usage:
configure memory <MODE>
Arguments:
<MODE>:streaming- Stream data over BLE to the host onlydevice- Store data in device memory onlyboth- Stream and store simultaneously
Note: SiFiBand only supports streaming.
Example:
configure memory streaming
Other configure subcommands
configure filtering <off|on>- Enable on-board filteringconfigure temperature --fs <0.1|1|2|10>- Configure the temperature sensorconfigure high-gain <off|on>- Enable high gain on the ECG and EMG ADCconfigure low-latency <off|on>- Pack data from multiple sensors into a single BLE packet for minimal per-sensor latency.configure ble-power <low|medium|high>- Set BLE transmission power levelconfigure night <off|on>- Disable LEDs during an acquisition (e.g. for sleep studies)
Use help configure <subcommand> for details on each.
Low latency mode is enabled by default.
In this mode, the device packs its BLE buffer with data from all sensors, thereby reducing the per-sensor latency. As a consequence, there is a ~10% BLE bandwidth overhead.
With low latency disabled, each sensor fills a dedicated buffer independently. Thus, sensors with a low sampling rate take a long time to fill the buffer, such that the perceived latency can be very high. This can still be useful to reduce the BLE bandwidth by about 10%.
Acquisition commands
start
Start data acquisition.
Usage:
start [OPTIONS]
Options:
--all- Start acquisition on all connected devices--set-default- Set the current configuration as the device default
Examples:
> start
> start --all --set-default
--set-default sets the current configuration as the device's default when starting an acquisition with the on-device button.
For instance, you can set a default configuration, and all subsequent button-initiated acquisitions will use that same configuration.
stop
Stop data acquisition.
Usage:
stop [OPTIONS]
Options:
--all- Stop acquisition on all connected devices
event
Generate a software event, inserting an event marker into the data stream.
Usage:
event [OPTIONS]
Options:
--all- Apply to all connected devices
Memory and data buffers
download-memory
Download data stored in the device's on-board memory into Sifi Bridge's buffers. Use buffer export afterwards to save the data to disk. Acquiring on-board recordings requires a memory mode of device or both (see configure memory).
Usage:
download-memory [--serial <SERIAL>]
Options:
--serial <SERIAL>- Serial port to use for the download (e.g./dev/ttyACM0). Downloading over serial is significantly faster than BLE. If omitted, the download happens over BLE.
Examples:
# Download over BLE
> download-memory
# Download over serial
> download-memory --serial /dev/ttyACM0
buffer
Manage the data buffers that hold acquisitions for real-time access, querying, and export. Streamed data is buffered automatically; on-board recordings are buffered by download-memory. See Buffering for how buffers are filled, kept, and cleared.
Usage:
buffer <COMMAND>
Subcommands: pull, info, clear, list, export.
Across the buffer subcommands, a device is addressed by its --handle (the device id or local name), and an acquisition by its --id. When --id is omitted, commands default to the latest acquisition.
buffer pull
Pull sensor data out of a buffered acquisition.
buffer pull --sensor <SENSOR> [OPTIONS]
Options:
-s, --sensor <SENSOR>(required) - Sensor type(s) to pull; repeat to pull several at once (ecg,emg,emg_armband,eda,imu,ppg,temperature,event)--handle <HANDLE>- Device handle (id or local name)--id <ID>- Acquisition ID (defaults to the latest acquisition)--last-seconds <LAST_SECONDS>- Return only the last N seconds of data--from <FROM>- Start of time range, in seconds since recording start--to <TO>- End of time range, in seconds since recording start
buffer info
Get acquisition details, including device configuration.
buffer info [--handle <HANDLE>] [--id <ID>]
buffer list
List acquisitions and their status.
buffer list [--handle <HANDLE>]
Options:
--handle <HANDLE>- Device handle to filter by (if not specified, lists all)
buffer clear
Clear buffered data.
buffer clear [OPTIONS]
Options:
--handle <HANDLE>- Device handle whose acquisitions should all be cleared--id <ID>- Acquisition ID to clear--all- Clear all buffered data
buffer export
Export buffered acquisitions to disk.
buffer export --format <FORMAT> [OPTIONS]
Options:
--format <FORMAT>(required) - Output format (csv,hdf5)--handle <HANDLE>- Device handle to export--dir <DIR>- Output directory (defaults to the current directory,./)
Example:
> buffer export --dir export/directory --format hdf5
See Export data to file for the difference between the hdf5 and csv formats.
Firmware
dfu
Update device firmware using a DFU (Device Firmware Update) package. The device will be rebooted and sifibridge will attempt reconnecting to it after the update.
Usage:
dfu [OPTIONS] <DFU_PACKAGE>
Arguments:
<DFU_PACKAGE>- Path to the DFU zip package
Options:
--handle <HANDLE>- Connection handle (defaults to the currently selected device)
Example:
> dfu /path/to/firmware.zip
If DFU fails, you can wait about a minute. The device will reboot into its normal operating mode. You can then retry doing the DFU.
Other commands
led
Turn a device LED on or off.
Usage:
led [OPTIONS] --state <STATE> <INDEX>
Arguments:
<INDEX>- LED index (1or2)
Options:
--state <STATE>(required) - LED state (off,on)--all- Apply to all connected devices
Example:
> led 1 --state on
motor
Control the vibration motor. Set the intensity, change the run state, or both — at least one of --intensity/--state is required. The motor only vibrates while its run state is on, and the intensity you set persists until changed.
Usage:
motor [OPTIONS] <--intensity <INTENSITY>|--state <STATE>>
Options:
--intensity <INTENSITY>- Vibration intensity (0–10)--state <STATE>- Motor run state (off,on)--all- Apply to all connected devices
Example:
# Set intensity and start the motor in one command
> motor --intensity 5 --state on
# Stop it
> motor --state off
power-off
Power off the device.
Usage:
power-off [OPTIONS]
Options:
--all- Apply to all connected devices
Example:
> power-off
Connect the device via USB to power it back on.
Utility commands
help
Display help for the REPL or a specific command, including options and value ranges.
help [COMMAND]
Examples:
> help
> help connect
> help configure ecg
quit
Exit the REPL. You can also use Ctrl+C or Ctrl+D.
quit
Invocation options
sifibridge is normally started in REPL mode, but it accepts top-level options and subcommands.
Options:
# Pretty-print JSON output
./sifibridge --pretty
# Bind a TCP port for input (remote control)
./sifibridge --tcp-in 127.0.0.1:5000
# Stream sensor data to TCP subscribers
./sifibridge --tcp-out 192.168.1.100:8080
# Send sensor data to a UDP port
./sifibridge --udp-out 192.168.1.100:9000
# Send sensor data to Lab Streaming Layer
./sifibridge --lsl
# Disable sending data to stdout
./sifibridge --no-stdout-data
# Increase / decrease logging verbosity
./sifibridge -v
./sifibridge -q
Subcommands:
repl- Read-Eval-Print Loop mode (the default when no subcommand is given)dfu- Update device firmware over BLEcompletion- Generate shell completion scriptsschema- Export JSON schemas for documentation
JSON response format
All commands return JSON responses. With --pretty, responses are pretty-printed. Response structures vary by command but generally echo the affected device's state (id, name, device, connected) and/or a command-specific payload. See the Quick start for annotated response examples, and Data output for the streamed data packet format.