# Install Switchyard on your Macs, iPhone and iPad

Use this guide from **Terminal on the Mac you want to control**. Your local Railway login gives you access to the private Mac installer and lets you enroll that machine in your existing Switchyard workspace. Repeat the Mac setup on each MacBook and the Mac mini. Agents run in the Git checkouts under each Mac’s own `~/Repos`.

The production project is **Switchyard** in **Ashwin Deepak’s Projects**, environment **production**, service **hub**. Its custom address is `https://switchyard.ashwwwin.com`. Its Railway address also works while custom DNS or TLS is pending. [Setup guide on the Railway address](https://hub-production-217f746d.up.railway.app/install.md)

## 1. Prepare the Mac

Use macOS 14 or later, a local Railway CLI signed in to the personal project, and the Xcode Command Line Tools for Git, Python and screenshot previews. The prebuilt Mac app is in the kit. Full Xcode is needed if you also build the iPhone or iPad app.

```zsh
railway whoami
xcode-select -p
/usr/bin/python3 --version
ls -d "$HOME/Repos"
```

If Railway reports that you are signed out, run `railway login` and select the account with access to the personal Switchyard project. If the developer tools are missing, run `xcode-select --install` and finish the macOS prompt. Put your checkouts in `~/Repos`. Install and sign in to the agent CLIs you want this Mac to offer. Run `codex login status` for Codex and `claude auth status` for Claude Code. A signed-in Codex CLI also provides GPT-6 Luna session titles.

## 2. Install and enroll this Mac

Paste this block into **zsh**. The first SSH command establishes Railway access before the download. If Railway asks you to register this Mac’s SSH public key, follow its prompt. If the Mac has no SSH key yet, run `ssh-keygen -t ed25519` once and keep the private key on this Mac. An existing key can also be registered with `railway ssh keys add --key ~/.ssh/id_ed25519.pub`. [Railway SSH](https://docs.railway.com/cli/ssh)

```zsh
(
  set -e
  target=(--project fb4283e5-decf-4dbc-a7f5-78dcb58ee270 --environment production --service hub)
  archive=/data/releases/Switchyard-Mac-Setup.zip
  railway ssh "${target[@]}" -- test -r "$archive"

  setup_dir=$(mktemp -d "$HOME/Downloads/Switchyard-Setup.XXXXXX")
  railway ssh "${target[@]}" -- cat "$archive" > "$setup_dir/kit.zip"
  /usr/bin/unzip -tq "$setup_dir/kit.zip"
  /usr/bin/ditto -x -k "$setup_dir/kit.zip" "$setup_dir"
  cd "$setup_dir/Switchyard-Mac-Setup"
  /usr/bin/python3 Tools/setup-railway-mac.py
  open "$HOME/Applications/Switchyard.app"
  printf 'Setup kit and Xcode project: %s\n' "$PWD"
)
```

Use a distinct display name for each Mac. A new enrollment uses the macOS computer name by default. To choose one, append `--name "MacBook Air"` to the setup helper command. Setup installs the desktop app, registers the Mac with its own host credential, indexes `~/Repos`, installs screenshot support, and starts the host in your login session. An already enrolled Mac can run setup again to repair or update its installation.

Keep the Mac awake and its user logged in while running agents remotely. Switchyard can show previously synced conversations when the Mac is offline.

## 3. Sign in on Mac, iPhone and iPad

In Switchyard, open the conversation menu and choose **Connect your hub**. Open **Details** if you need to change the address. Use `https://switchyard.ashwwwin.com` once its health check succeeds. Until then, use `https://hub-production-217f746d.up.railway.app`. Leave the certificate fingerprint blank for either address.

To copy the workspace password to this Mac’s clipboard, run the command below. Paste it into Switchyard, or save it in your password manager for your iPhone and iPad. Each device receives its own revocable sign-in.

```zsh
railway run --no-local --project fb4283e5-decf-4dbc-a7f5-78dcb58ee270 \
  --environment production --service hub -- /bin/sh -c \
  'test -n "$SWITCHYARD_WORKSPACE_PASSWORD" && printf %s "$SWITCHYARD_WORKSPACE_PASSWORD" | /usr/bin/pbcopy'
```

To install on a physical iPhone or iPad, open `Switchyard.xcodeproj` from the extracted kit in Xcode, select the **Switchyard** target, choose your Apple development team under **Signing & Capabilities**, select the connected device, and press **Run**. The mobile app requires iOS or iPadOS 17 or later. Complete device trust or Developer Mode prompts if Apple presents them. Once the app is installed, sign in using the same hub and workspace password.

**Verify remote control.** On the phone, turn off Wi-Fi and use cellular. In Switchyard, open **Repositories**, select the enrolled Mac and a checkout, and start a Codex or Claude chat. A reply verifies the full path from the phone through Railway to the agent on that Mac. Open the same chat on another signed-in device to verify history sync.

## If the Mac appears offline

Run these commands as the user who enrolled the Mac.

```zsh
launchctl print "gui/$(id -u)/dev.switchyard.host"
tail -n 30 "$HOME/Library/Application Support/Switchyard/Host/host.log"
```

If launchd reports that it cannot find the service, run `/usr/bin/python3 Host/switchyard_host.py install` from the extracted kit in that Mac’s normal Terminal. The host sends a heartbeat about every ten seconds and refreshes the repository list about once a minute. When a Mac is already enrolled under the Railway address, it can keep using that address while your other devices use the custom domain. Both reach the same workspace.

## One-time domain setup

Railway routes `switchyard.ashwwwin.com` to port **8080** on the existing hub. The authoritative DNS zone is at Namecheap. In **Domain List → Manage → Advanced DNS → Host Records**, add these records with **Automatic** TTL. Namecheap appends `ashwwwin.com` to the Host field.

| Type | Host | Value |
| --- | --- | --- |
| CNAME | `switchyard` | `q3xsomnc.up.railway.app` |
| TXT | `_railway-verify.switchyard` | `railway-verify=09636239b436e1be555f264bdee03a996d1bfe075b95b5b58a6f0553a73f8302` |

Railway’s CLI reports the required values and certificate status. If the custom domain is ever recreated, use the new values it reports. This registrar step is shared by all devices.

```zsh
railway domain status switchyard.ashwwwin.com \
  --project fb4283e5-decf-4dbc-a7f5-78dcb58ee270 --environment production --service hub --json
curl --fail --show-error --silent https://switchyard.ashwwwin.com/healthz
```

A valid HTTPS response of `{"status":"ok"}` means the custom hostname is ready. The public Markdown guide is served at both `/` and `/install.md`. The installer is available through private Railway SSH. Sign-in protects the workspace and machine commands.

## Updating the hub and private kit

Use these commands from your Switchyard source checkout when publishing a new release. The production hub keeps sessions on its `/data` volume and verified daily SQLite backups in a private bucket. Installing an additional Mac uses step 2 above.

```zsh
(
  set -e
  set -o pipefail
  target=(--project fb4283e5-decf-4dbc-a7f5-78dcb58ee270 --environment production --service hub)
  ./Install-Switchyard.command --from-source --no-open
  ./Tools/package-mac.sh
  railway up "${target[@]}" --ci --message "Update Switchyard hub and setup guide"
  railway deployment list "${target[@]}" --limit 1 --json

  archive=Build/Switchyard-Mac-Setup.zip
  digest=$(/usr/bin/shasum -a 256 "$archive" | /usr/bin/awk '{print $1}')
  pending="/data/releases/kit-$(uuidgen).zip"
  railway ssh "${target[@]}" -- "umask 077 && mkdir -p /data/releases && cat > '$pending'" < "$archive"
  railway ssh "${target[@]}" -- "echo '$digest  $pending' | sha256sum -c - && mv '$pending' /data/releases/Switchyard-Mac-Setup.zip"
)
```

The checksum verifies the private upload before replacement. After Railway reports a successful deployment, fetch `/healthz` and `/install.md` and rerun step 2 on each Mac receiving the update. [Production project](https://railway.com/project/fb4283e5-decf-4dbc-a7f5-78dcb58ee270)
