Synheart CLI vs Wear CLI: The Synheart CLI generates mock HSI data locally. For streaming real data from cloud wearables (WHOOP, Garmin, Fitbit), use the Wear CLI.
Features
- Mock HSI Data Streams: Generate realistic sensor data without physical devices
- Multiple Scenarios: Pre-built scenarios for baseline, focus, stress, and workout
- WebSocket Broadcasting: Real-time data streaming on localhost
- Record & Replay: Capture sessions for reproducible testing
- Deterministic Mode: Use seeds for consistent, repeatable data generation
- Developer Friendly: Simple CLI with clear documentation and easy SDK integration
Prerequisites
Before installing the Synheart CLI, ensure you have:- Go 1.24 or later installed
Installation
Install Globally (Recommended)
Install the CLI to make it available system-wide:$GOPATH/bin (typically $HOME/go/bin).
Ensure Go’s bin directory is in your PATH:
Add this line to your ~/.zshrc, ~/.bashrc, or ~/.bash_profile:
Build Locally (Development)
To build without installing globally:bin/synheart. Run it with:
Quick Start
Start the mock server with default settings:- Generate baseline scenario data
- Start WebSocket server on
ws://127.0.0.1:8787/hsi - Broadcast events to all connected clients
Commands
mock start
Start generating and broadcasting HSI events.| Flag | Description | Default |
|---|---|---|
--host | Host to bind to | 127.0.0.1 |
--port | Port to listen on | 8787 |
--scenario | Scenario to run | baseline |
--duration | Duration to run (e.g., 5m, 1h) | unlimited |
--rate | Global tick rate | 50hz |
--seed | Random seed for deterministic output | random |
--out | Record events to file (NDJSON format) | - |
mock record
Record mock data to an NDJSON file.| Flag | Description | Default |
|---|---|---|
--scenario | Scenario to run | baseline |
--duration | Duration to record | 5m |
--out | Output file (required) | - |
--seed | Random seed for deterministic output | random |
--rate | Global tick rate | 50hz |
mock replay
Replay events from a recorded file.| Flag | Description | Default |
|---|---|---|
--in | Input file to replay (required) | - |
--speed | Playback speed multiplier | 1.0 |
--loop | Loop playback continuously | false |
--host | Host to bind to | 127.0.0.1 |
--port | Port to listen on | 8787 |
mock list-scenarios
List all available scenarios.mock describe
Show detailed information about a scenario.doctor
Check environment and print connection examples.- Scenarios directory exists
- Default port availability
- Provides SDK connection examples
version
Print version information.Built-in Scenarios
baseline
Normal day idle with minor variance. Suitable for testing basic SDK functionality. Duration: Unlimited Use case: General SDK testing and developmentfocus_session
Reduced motion, stable heart rate, screen on patterns. Simulates a 30-minute focused work session. Duration: 30 minutes Use case: Testing focus detection and work session trackingstress_spike
Sudden heart rate increase, HRV drop, EDA spike followed by recovery. Duration: 8 minutes Use case: Testing stress detection and recovery algorithmsworkout
Cardio workout with warmup, run, cooldown phases. Includes HR increase, HRV decrease, and EDA elevation. Duration: 30 minutes Phases: Warmup (5m) → Run (20m) → Cooldown (5m) Use case: Testing activity detection and workout trackingEvent Schema
All events follow the HSI-compatible envelope format:Supported Signals
Wearable Signals
| Signal | Description | Unit |
|---|---|---|
ppg.hr_bpm | Heart rate | bpm |
ppg.hrv_rmssd_ms | Heart rate variability | milliseconds |
accel.xyz_mps2 | 3D acceleration | m/s² |
gyro.xyz_rps | 3D gyroscope | rad/s |
temp.skin_c | Skin temperature | Celsius |
eda.us | Electrodermal activity | microsiemens |
Phone Signals
| Signal | Description |
|---|---|
screen.state | Screen on/off state |
app.activity | App foreground/background activity |
motion.activity | Motion activity (still/walk/run) |
SDK Integration
JavaScript/Node.js
Python
Dart/Flutter
Swift
Kotlin
Go
Rust
Use Cases
SDK Development
Test HSI SDKs without physical wearables during development
CI/CD Pipeline
Automated testing with deterministic, reproducible data
Demos & Presentations
Scripted scenarios that look realistic for demonstrations
Integration Testing
Validate data pipelines and processing logic locally
Recording Format
Recordings use NDJSON (Newline Delimited JSON) format - one JSON object per line. Benefits:- Streaming-friendly
- Easy to parse
- Human-readable
- Compatible with standard tools
Advanced Usage
Deterministic Testing
Generate the same data sequence across multiple runs:Record and Replay Workflow
Custom Port for Multiple Instances
Run multiple scenarios simultaneously on different ports:Piping Data to Custom Scripts
Troubleshooting
Port already in use
Port already in use
If port 8787 is already in use:Or find and kill the process using the port:
Scenarios not found
Scenarios not found
Ensure the
scenarios/ directory is in:- Current working directory
- Same directory as the executable
WebSocket connection refused
WebSocket connection refused
- Ensure the server is running:
synheart mock start - Check firewall settings
- Verify the correct host and port
- Check server logs for errors
'synheart' command not found
'synheart' command not found
The Go bin directory may not be in your PATH.Solution:Or use the binary directly:
Security Notes
- Binds to
localhost(127.0.0.1) by default for security - Only generates synthetic data, never real user data
- Use
--host 0.0.0.0with caution (exposes on LAN)
Next Steps
Synheart Wear SDK
Integrate HSI data into your mobile app
Synheart Emotion SDK
Process sensor data for emotion detection
Integration Guides
Comprehensive integration examples
GitHub Repository
View source code and contribute
Author: Israel Goytom