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

syq exec

Run a command on your laptop from a server, with approval on the laptop:

syq exec --on @laptop --cwd work/project -- cargo test

See Run commands on your laptop for setup.

syq exec [OPTIONS] --on <@NAME> -- <PROGRAM>...

Arguments

Argument / optionMeaning
<PROGRAM>...Program and literal arguments; use sh -c explicitly for shell syntax

Options

Argument / optionMeaning
--on <@NAME>Receiving name of the machine to run on; it must be connected to this server now, and syq never uses SSH instead
-C, --cwd <DIR>Working directory on that machine, relative to its receiving profile’s starting directory

[default: .]

Help and version

Argument / optionMeaning
-h, --helpShow common usage and options
--help-allShow all options and details

Approve each command locally

Every command needs approval on the laptop, even when copies are approved automatically. Review the program, arguments, requesting server, and working directory before you approve it. If the desktop prompt is missing or truncated, answer from a terminal on the laptop:

syq persist receive pending
syq persist receive approve REQUEST_ID
syq persist receive deny REQUEST_ID

A request expires after five minutes. Approved commands run with your full user permissions: the receiving --root and copy limits do not restrict them. See Commands on your laptop.

Arguments and working directories

Put -- before the program. Everything after it is passed as given, with no shell, so run a shell when you need shell syntax:

syq exec --on @laptop --cwd work/project -- sh -c 'cargo build && ./target/debug/demo'

Without --cwd, the command runs in the receiving profile’s directory, which syq persist receive status shows. A relative --cwd is resolved from there, an absolute one is used as given, and ~ is not expanded. The directory must already exist; the prompt shows it with symlinks and .. resolved, and the command runs there. The command gets the environment of the receiving service on the laptop, including its PATH, not the server’s; to change it, restart receiving from a terminal in the session you want. It has no terminal and no standard input.

Output, completion and cancellation

Output streams back to your terminal, and syq exec exits with the command’s exit code, or 128 + signal if a signal killed it. Setup failures and a lost connection also exit nonzero.

Interrupting the request, stopping or changing receiving, or losing the connection kills the command’s process group at once, without cleanup handlers. When the command exits, syq also stops anything left in its process group. Detached processes and applications started with macOS open can keep running.

Execution details

A request allows up to 256 arguments (16 KiB in total). Each server connection allows one pending approval and eight running commands.