Skip to main content

Development Guide

Setup

Prerequisites

  • macOS 14.0+
  • Xcode 16.0+
  • Node.js 22.12 through 24.x
  • Bun 1.0+
  • Rustup (native/vt-fwd/rust-toolchain.toml pins the forwarder toolchain)

Clone & Build

Project Structure

Code Patterns

Swift (macOS/iOS)

Observable Pattern
Protocol-Oriented Design
Error Handling

TypeScript (Web)

Service Classes
Lit Components

Development Workflow

Hot Reload Setup

Web Development
Swift Development with Poltergeist

Testing

Unit Tests
E2E Tests

Debugging

View Logs
Debug Server

Common Tasks

Add New API Endpoint

  1. Define in web/src/server/routes/api.ts
  2. Add types in web/src/shared/types.ts
  3. Update client in web/src/client/services/api.ts
  4. Add tests in web/tests/api.test.ts

Add New Menu Item

  1. Update mac/VibeTunnel/Presentation/MenuBarView.swift
  2. Add action in mac/VibeTunnel/Core/Actions/
  3. Update settings if needed

Modify Terminal Protocol

  1. Update framing/types in web/src/shared/ws-v3.ts
  2. Update server routing in web/src/server/services/ws-v3-hub.ts
  3. Update clients:
    • Web: web/src/client/services/terminal-socket-client.ts
    • iOS: ios/VibeTunnel/Services/BufferWebSocketClient.swift
  4. Add/adjust tests: web/src/test/e2e/websocket-v3.e2e.test.ts

Build System

macOS Build

Web Build

Release Build

Code Quality

Linting

Formatting

Performance

Profiling

Optimization Tips

  • Use binary protocol for terminal data
  • Batch WebSocket messages (16ms intervals)
  • Lazy load terminal sessions
  • Cache static assets with service worker

Troubleshooting

Contributing

  1. Fork repository
  2. Create feature branch
  3. Follow code style
  4. Add tests
  5. Update documentation
  6. Submit PR

See Also