Send commands with the remocon CLI
remocon is a CLI that sends messages to an IOSignal server. Use it to send once and exit from a shell script, or to send your terminal's lines or keys to control a device. For running a server and interactive debugging, use iosignal-cli. Both CLIs are released together from one repository (iosignal-cli, packages/remocon).
Install
Requires Node.js 22.16.0 or later.
npm install -g remocon
This installs two commands, remocon and remote.
Connection options
The default server is wss://io.remocon.kr/ws. Common options go before the subcommand.
remocon -c ws://localhost:7777 pub demo hello
remocon -c cong://localhost:8888 input demo --keys
remocon -c ws://localhost:7777 -i uno -k uno-key console
| Option | Description |
|---|---|
-c, --connect <url> | ws://, wss:// or cong://. A bare host:port is WebSocket |
-i, --id <id> / -k, --key <key> | Login ID and key, given together |
-a, --auth-idKey <id.key> | Short form of the credentials. An -i/-k pair wins |
-j, --join-channel <tags> | Subscribe on start, comma separated |
-t, --timeout <ms> | Limit for connecting, the exit check and service replies. Default 10000 ms |
-h, --help / -V, --version | Help / version |
Keys on the command line can stay in shell history or the process list.
Send once
remocon pub demo hello world # two payloads: hello, world
remocon pub demo "hello world" # one payload
remocon call reply echo hello # call a server service and print the reply
remote demo hello # the old syntax still works
pub, publish, sig and signal do the same thing. The CLI sends after the connection is ready, and before exiting it checks with a server echo that the server got the earlier messages. That check does not mean the receiving device handled them. To confirm, subscribe to the device's reply such as its $state.
To command one device, send directly to its CID followed by @ (the device receives it on @).
remocon pub "?k3vd@" toggle # toggle command to the anonymous device ?k3vd
Line input
remocon input demo # --lines is the default
printf 'first\nsecond\n' | remocon input demo
Each Enter sends the whole line as one string. Leading and trailing spaces, empty lines and quotes are kept. Piped input exits after everything is sent.
Key input
remocon input demo --keys
In a TTY terminal each key press is sent right away. Characters are sent as themselves (a, A, non-Latin letters after IME composition), special keys by name (up, down, enter, ctrl+a, f1). Ctrl+C exits without sending. This is the current terminal's input, not a system-wide keyboard hook, and there are no key-release events. On the receiving side, the text up and the arrow key name are the same string.
Interactive commands
Run remocon without arguments (or remocon console) to start interactive commands. They match iosignal-cli (sub, pub, call, id, ping and so on, no leading dot), and quotes group arguments with spaces. input <tag> enters line input mode and .back returns. help shows the full list.
pingis the server ping. From 9.19.0 there is noping <cid>to another peer.- On every connect the CLI names its connection with
iam('remocon-cli').