Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Advanced: CLI Reference

Run MIDI Router Client from the command line for scripting, automation, and headless deployments.

Availability

  • macOS and Linux: CLI included with application
  • Windows: Install CLI tool via scoop install -g midi-router-client-cli

Basic Syntax

./midi-router-client [options]

Options Reference

Information

OptionEffect
-h, --helpDisplay command-line help message
--help-allDisplay help including generic Qt options
 /Applications/midi-router-client.app/Contents/MacOS/midi-router-client -h
Usage: /Applications/midi-router-client.app/Contents/MacOS/midi-router-client [options]

Options:
  -h, --help  Displays help on commandline options.
  --help-all  Displays help, including generic Qt options.
  --headless  Run in headless mode on the specified port by the gui.
               --config-file  <path>    Full path to config file.
               --server-port  <path>    serevr port.
  --apply     Apply a preset (local or remote).
               --address <address>      Remote address (ip:port).
               --preset-name <preset>   Preset name (regex) to apply, use "" to
              list presets
  --quit      Quit server (local or remote).
               --address <address>      Remote address (ip:port).

Headless Mode

./midi-router-client --headless

Runs the application without a GUI. Useful for server deployments or background automation.

Additional options for headless:

  • --config-file <path> — Full path to configuration file
  • --server-port <port> — Server port number

Apply Preset

./midi-router-client --apply \
  --address <address> \
  --preset-name <preset>

Applies a preset on the local machine or remote server. Returns exit code 0 on success.

Parameters:

  • --address <address> — Remote address in format ip:port (e.g., 127.0.0.1:2222)
  • --preset-name <preset> — Preset name or regex pattern; use "" to list all presets

Examples

Example 1: List All Available Presets

./midi-router-client --apply --address 127.0.0.1:2222 --preset-name ""

Outputs all preset names available on the specified server.


Example 2: Apply a Specific Preset Locally

./midi-router-client --apply --preset-name "neutron"

Activates the “neutron” preset on the local machine.


Example 3: Apply a Preset on Remote Server

./midi-router-client --apply --address 192.168.1.100:2222 --preset-name "studio"

Activates the “studio” preset on a remote server at 192.168.1.100:2222.


Example 4: Start in Headless Mode

./midi-router-client --headless \
  --config-file /path/to/config.json \
  --server-port 2222

Starts the server without a GUI, loads the configuration, and listens on port 2222.


Exit Codes

CodeMeaning
0Success
1Error or failure

The exit code is particularly useful for scripting and automation — check it to verify if an --apply operation succeeded.


Use Cases

Use Case 1: Automated Preset Switching

Trigger preset changes from cron jobs or external scripts:

# Every hour at 30 minutes past, switch to "practice" preset
30 * * * * /path/to/midi-router-client --apply --preset-name "practice"

Use Case 2: Remote Server Management

Deploy MIDI Router Client on a headless server and control it remotely:

# On server:
./midi-router-client --headless --config-file config.json --server-port 2222

# From client machine:
./midi-router-client --apply --address server.local:2222 --preset-name "main"

Use Case 3: Script Validation

Verify preset application succeeded before proceeding:

#!/bin/bash
./midi-router-client --apply --preset-name "gig"
if [ $? -eq 0 ]; then
  echo "✅ Preset applied successfully"
else
  echo "❌ Preset application failed"
  exit 1
fi

See Also