SECURE PIPES 2.0.15 User guide

Automate with AppleScript and spcli

Start saved connections and tagged groups from scripts while keeping connection configuration in the app.

Use the built-in reference

Open Automation. It provides AppleScript and Command line (spcli) tabs with editable examples and copy controls. Start by listing names rather than guessing them.

Automation page showing the built-in AppleScript command reference

Automation is a Pro feature after the shared seven-day trial. macOS may ask the calling application, such as Terminal, for permission to control Secure Pipes. Allow that only for a caller you trust.

List connections with AppleScript

osascript -e 'tell application "Secure Pipes" to list connections'

Use a returned name in subsequent commands. Where names repeat, use the full name with its connection type as shown by the app.

tell application "Secure Pipes"
    connect connection "Database Tunnel (Local Forward)"
    connection status "Database Tunnel (Local Forward)"
end tell

Starting a connection is asynchronous. Check status rather than assuming the command's return means the tunnel is ready. Authentication, host trust and errors can require user attention.

Control groups

The AppleScript and spcli group commands iterate profiles with the matching tag. They do not use the Connection Groups window’s Concurrent/Sequential or On Failure settings. A start request can return before SSH is connected, and an immediate start error stops the remaining requests. To use the configured startup policy, start the group from the app’s group controls.

Groups are tags assigned to connection profiles. The group commands act on matching profiles:

tell application "Secure Pipes"
    list connection groups
    connect group "engineering"
    disconnect group "engineering"
end tell

Review every member before starting a group. A group operation can start multiple real listeners. Use disconnect connection to stop one profile rather than an entire group.

Install and use spcli

In General → Command-Line Tool, choose Install spcli if it is not installed. Open a terminal and run:

spcli --help

Use the installed version's help and the Command line (spcli) tab for exact commands and options. Keep private keys and passwords out of command arguments, shell history and scripts. spcli operates on the app's saved setup; it is not a replacement for server-side authorization.

Common spcli commands

Start with read-only discovery:

spcli list connections
spcli list groups
spcli list connections --json

Replace the demonstration connection name below with the exact name returned by your installed app. Run each command when you need that action; this block is not a script to run all at once.

spcli connect "Database Tunnel (Local Forward)"
spcli status "Database Tunnel (Local Forward)"
spcli status "Database Tunnel (Local Forward)" --json
spcli disconnect "Database Tunnel (Local Forward)"

As with AppleScript, a successful connect command does not prove that the destination is ready. Inspect status and handle authentication or host-trust prompts in the app before starting dependent work.

For a tag named engineering, use spcli connect-group "engineering" or spcli disconnect-group "engineering". Check the membership first: these commands affect the whole matching group.

Command Effect
spcli start Start Secure Pipes without showing its window
spcli show Show and activate the app window
spcli hide Hide the app windows without quitting
spcli shutdown Quit the app; active connections are stopped

For scripts, check the exit code: 0 means command success, 1 an app-reported error, 2 invalid usage, 3 an app launch or Automation-permission problem, and 4 an Apple Event send, timeout or reply failure. --json is available for list and status commands. Preserve the returned status text rather than assuming it is an untranslated constant.

Inspect and control routing

The installed spcli --help groups commands by purpose. These commands operate on saved settings; replace Office with an existing scenario name:

spcli list proxy-servers --json
spcli list rules --json
spcli list scenarios --json
spcli current-scenario
spcli preview-route example.com 443 com.example.browser TCP --json
spcli switch-scenario "Office"
spcli transparent-proxy-status --json
spcli start-transparent-proxy
spcli sharing-status --json
spcli list flows --json
spcli list logs --json

preview-route predicts the current local rule decision without opening the target. switch-scenario disconnects active proxy connections so new ones use that scenario. Use enable-rule, disable-rule and set-rule-scenarios to edit saved rule state; create-scenario, rename-scenario and delete-scenario manage the scenario list. Sharing has separate set-sharing-modes, start-sharing and stop-sharing commands. Starting the transparent proxy can require the system extension and user approval.

The list sharing-flows command and log-detail <log-id> show activity and details. The log list returns at most 200 redacted entries. The end-flow command ends one connected flow, which an app may reopen. The Automation page also provides corresponding AppleScript reference and runnable examples. Do not assume a successful command proves that remote traffic was delivered.

Scripts and connection completion

Per-connection settings can run a local script or supported completion action after connection. Remote forwards also expose a remote-script option. These are separate from AppleScript controlling the app.

Only enable scripts you understand and trust. Do not put secrets in exported script examples. Use the built-in examples' bounded status-wait pattern when a later task depends on the connection being ready, and handle failure states instead of waiting forever.

Configure actions after connection

Edit a profile and find When connected. Choose Do nothing or Open URL; local forwards also offer Open VNC, and SOCKS profiles offer Open proxy browser. Review the displayed destination and browser/VNC app, then save the profile. Open again after reconnect controls whether the action repeats after reconnection. SSH reaching Connected triggers the action; it does not establish that the target web/VNC service is healthy. These optional actions require Pro after the shared trial.

Local and remote scripts

Local Script runs on your Mac after connection. Enable it only after reviewing the script and shell. Its Run again after reconnect option is separate from the URL/browser action. Stop on error controls script execution, not the group failure policy. Remote forwards also offer Remote Script, which runs on the SSH server under the SSH account; do not confuse it with a local command. Repeated reconnects can repeat enabled scripts. Keep secrets out of scripts, and disable actions while diagnosing the tunnel itself.

Based on Secure Pipes 2.0.16 · Updated November 3, 2026