CLI Reference

The SerialFlow CLI lets you connect local serial devices to SerialFlow from your terminal.

Installation

macOS (Homebrew)

brew install serialflow/tap/serialflow

Linux

curl -fsSL https://serialflow.app/install.sh | bash

Windows

Download the latest release from GitHub Releases.

Authentication

Before using the CLI, authenticate with your SerialFlow account:

serialflow auth login

This opens a browser window for authentication. Once complete, your credentials are stored securely.

# Check authentication status
serialflow auth status

# Log out
serialflow auth logout

Connecting Devices

Basic Connection

serialflow connect --port /dev/ttyUSB0

With Baud Rate

serialflow connect --port /dev/ttyUSB0 --baud 115200

List Available Ports

serialflow ports

Output:

PORT            DESCRIPTION
/dev/ttyUSB0    USB Serial Device
/dev/ttyACM0    Arduino Uno

Session Management

Create a New Session

serialflow session create --name "My Arduino Project"

Connect to Existing Session

serialflow connect --session abc123

List Sessions

serialflow session list

Configuration

View Current Config

serialflow config show

Set Default Baud Rate

serialflow config set default_baud 115200

Configuration File

The CLI stores configuration in ~/.config/serialflow/config.json:

{
  "default_baud": 115200,
  "default_port": "/dev/ttyUSB0",
  "api_endpoint": "https://api.serialflow.app"
}

Environment Variables

Variable Description
SERIALFLOW_TOKEN API token for non-interactive auth
SERIALFLOW_API_URL Override API endpoint
SERIALFLOW_LOG_LEVEL Set log verbosity (debug, info, warn, error)

Exit Codes

Code Meaning
0 Success
1 General error
2 Connection failed
3 Authentication required
4 Device not found

Troubleshooting

Permission Denied on Linux

Add your user to the dialout group:

sudo usermod -a -G dialout $USER
# Log out and back in for changes to take effect

Device Not Appearing

  1. Check the cable connection
  2. Try a different USB port
  3. Verify the device is powered on
  4. Run serialflow ports --verbose for debugging info

See Also