curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shMinimum: Rust stable (edition 2021). The runner uses sqlx with compile-time query checking — set SQLX_OFFLINE=true if you don't have a local database.
brew install protobuf swift-protobuf grpc-swiftXcode 26.4+ from the Mac App Store. Target: macOS 26+, Apple Silicon only.
brew install swiftlintbrew install grpcurlDocker Desktop or colima for container-backed sessions.
relay/
├── runner/ # Rust gRPC+REST server
│ ├── src/ # Source code (~5000 LOC)
│ ├── migrations/ # SQLite migrations (sqlx)
│ └── Cargo.toml
├── MacApp/ # Swift macOS client
│ ├── Packages/ # SPM packages (11 modules)
│ ├── Relay/ # App target
│ └── Relay.xcodeproj
├── proto/ # Protobuf definitions
│ └── terminal.proto
├── docker/ # Docker support files
└── docs/ # Documentation
cd runner
cargo check # Fast compilation check
cargo build # Debug build
cargo build --release # Release buildxcodebuild build \
-project MacApp/Relay.xcodeproj \
-scheme Relay \
-destination 'platform=macOS,arch=arm64' \
CODE_SIGN_IDENTITY=-Or open MacApp/Relay.xcodeproj in Xcode.
./proto/generate.shGenerates Swift code into MacApp/Packages/RemoteTerminal/Sources/RemoteTerminal/Generated/. Rust codegen is automatic via runner/build.rs.
cd runner
RUST_LOG=info cargo runStarts the gRPC server on :50051 and REST API on :8080.
cd runner
cargo run -- init --cloud # Creates CA, config, database
RUST_LOG=info cargo run # Starts with cloud_mode=truegrpcurl -plaintext localhost:50051 list
grpcurl -plaintext localhost:50051 relay.terminal.v1.TerminalService/ListSessions
grpcurl -plaintext -d '{}' localhost:50051 relay.terminal.v1.TerminalService/CreateSessioncurl http://localhost:8080/healthz
curl http://localhost:8080/api/v1/openapi.json
# With auth:
curl -H "Authorization: Bearer <token>" http://localhost:8080/api/v1/healthcd runner
cargo test # All unit tests
cargo test test_name # Single test
cargo clippy -- -D warnings # Lint (matches CI)
cargo fmt --check # Format checkcd MacApp
swiftlint lint --strict
xcodebuild test \
-project Relay.xcodeproj \
-scheme Relay \
-destination 'platform=macOS,arch=arm64' \
CODE_SIGN_IDENTITY=-Single workflow .github/workflows/ci.yml, path-filtered:
| Job | Trigger | Steps |
|---|---|---|
| Rust | runner/**, proto/** |
fmt → clippy → test → build release |
| Security | runner/** |
cargo audit |
| Swift | MacApp/**, proto/** |
SwiftLint → build → test |
| Proto | proto/** |
buf lint → buf breaking (PRs only) |
| Docker | Dockerfiles, compose | build (no push, GHA cache) |
Branch protection requires the CI summary job to pass. All changes go through PRs.
unsafe_code = "deny"— no unsafe blocks allowedclippy::pedanticwarnings enabledclippy::dbg_macro = "deny"— no debug prints
SWIFT_STRICT_CONCURRENCY = complete— full Sendable/actor isolationSWIFT_TREAT_WARNINGS_AS_ERRORS = YES— zero-warning policyswiftLanguageMode(.v6)on all SPM targetsExistentialAnyupcoming feature enabled